mardi 24 novembre 2015

Multiple where in clause in Mysql

When using the following query Im getting the incorrect results. How can I fix this when working with multiple where in clauses and HAVING

SELECT item
FROM Table
WHERE fld1 IN ('1', '3', '5')
WHERE fld2 IN ('4', '3')
GROUP BY item
HAVING COUNT(DISTINCT fld1) = 3
AND    COUNT(DISTINCT fld2) = 2



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire