How to check group for containing certain elements in SQL? -


i have simple table:

id num  1 7 1 5 1 4  2 5 2 4 2 7  3 4 3 7 

how select ids having num 5 7 , 4

for example ids: 1, 2

select `id` `table` `num` in (4, 5, 7) group `id` having count(*) = 3 

Comments

Popular posts from this blog

php - How to build a web site which gives a sub-domain dynamically to every registered user? -

Delphi Wmi Query on a Remote Machine -