Sql Query [message #85377] |
Sun, 20 June 2004 20:45 |
amit goel
Messages: 20 Registered: March 2004
|
Junior Member |
|
|
Suppose table: Sales having values
Sid Product
1 A
1 B
1 C
2 A
2 B
3 A
3 B
3 C
4 B
Please help me to write a SQL statement to find out those SID who has all the products and the SID and Product list grows dynamically.
|
|
|
Re: Sql Query [message #85379 is a reply to message #85377] |
Mon, 21 June 2004 00:31 |
nsk
Messages: 16 Registered: June 2004
|
Junior Member |
|
|
u can try with this query
select sid,count(*) as a from ssales group by sid
having count(*) = (select max(count(*)) from ssales group by sid)
|
|
|