In SQL Server 2008, I have below Table Sample.
Name Num
----------
John 20
John 30
Peter 10
Peter 20
Peter 30
Marry 20
Marry 30
Mike 10
Mike 20
Mike 30
Phil 10
Phil 30
I want records having Num = 10 and Num = 20. The query will return
Name Num
----------
Peter 10
Peter 20
Mike 10
Mike 20
Many thanks.
You want something like this:
But there are other ways to skin the “set of items with all the following attributes” cat.