Any of them will give the desired result:
SELECT * FROM Sample WHERE Num IN (10, 20)
or
SELECT * FROM Sample WHERE Num = 10 OR Num = 20
EDIT : Sorry, this doesn't seem to be what you wanted. I believe this will work, but it is not very elegant:
SELECT * FROM Sample
WHERE Name IN (SELECT Name FROM Sample WHERE Num = 10)
AND Name IN (SELECT Name FROM Sample WHERE Num = 20)
Perhaps the best solution. Sorry for misunderstanding.
source
share