Mysql
 sql >> Base de données >  >> RDS >> Mysql

SELECT plusieurs lignes WHERE correspondant à deux conditions

Essayez,

SELECT userID
FROM tableName
WHERE   (questionID = 14 AND
        answer = 'yes' ) OR
        (questionID = 54 AND
        answer <> 'empty') OR
        (questionid = 100 AND
        answer > 10)
GROUP BY userID
HAVING COUNT(*) = 3

Démo SQLFiddle