php - IN operator only returns if parameter is a specific value -


i have questions table (that contains questions) , tags table (that contains tags (represented integers) each question).

what trying list of questions have same tag in in operator.

however, query returns questions if 1 there , 0 if isn't there. doesn't return questions tag integer matches in operator.

here sqlfiddle: http://sqlfiddle.com/#!2/c2ded3/2

it seems id in id = questions_tags.q_id somehow ambiguous. if more specific, succeeds:

select id questions exists (     select 1 questions_tags           questions.id = questions_tags.q_id ,           questions_tags.t_id in (1) ); 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -