Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Rakesh Kumar writes "Dear ,i have three table like cutstomer_master(cust_id,Cust_name),Item_master(item_id ,Item_name) and transaction table Cust_item(cust_id,Item_id) i need to display the name of cutomer who purchase all the item .Plz Help Me I am struggling very hard "
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2006-06-06 : 09:24:45
try this
select c.cust_id, c.cust_namefrom customer_master c inner join cust_item ion c.cust_id = i.cust_idgroup by c.cust_id, c.cust_namehaving count(*) = (select count(*) from item_master)