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.
Author |
Topic |
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2012-05-05 : 12:11:33
|
I have 2 tables. I only want to bring back sellers who have product available. Sally has none1st table sellersellerID Seller Name1 Bob2 Jim3 sally2nd table productsellerID isSold(bit)1 01 01 12 02 0DaveHelixpoint Web Developmenthttp://www.helixpoint.com |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-05 : 12:31:11
|
[code]select s.SellerNamefrom seller sinner join product pon p.sellerID = s.sellerIDgroup by s.SellerNamehaving sum(case when isSold=0 then 1 else 0 end) >0[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|