sql >> Base de Datos >  >> RDS >> Mysql

SELECCIONE varias filas DONDE coincidan dos condiciones

Prueba,

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

Demostración de SQLFiddle