Search Results

Search found 1 results on 1 pages for 'user1735943'.

Page 1/1 | 1 

  • mysql select when matching multiple rows

    - by user1735943
    I have a project where I need to select only the users that answered to some questions in a certain way (based on a filter). The filter table (filter) looks like this question | answer Q1 | A Q2 | B The user table (answers) looks like this user | question | answer 1 | Q1 | A 1 | Q2 | D 2 | Q1 | A 2 | Q2 | B How can I select from the user table only the user(s) that match the filter? I tried "SELECT user FROM answers WHERE (question = Q1 AND answer = A) AND (question = Q2 AND answer = B)" and it doesn't work -- I get an empty result. Thank you.

    Read the article

1