SELECT score
FROM t
WHERE id in (2, 4)
HAVING COUNT(*) = 2 /* replace this with the number of IDs */
This selects the rows with ID 2 and 4. The HAVING
clause then ensures that we found both rows; if either is missing, the count will be less than 2.
This assumes that id
is a unique column.