View Single Post
  #3 (permalink)  
Old May 17th, 2007, 09:23 AM
sshelper sshelper is offline
Authorized User
 
Join Date: Oct 2005
Location: , , .
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can try this query:

SELECT CustomerID
FROM Customers A INNER JOIN Branches B ON A.BranchName = B.BranchName
GROUP BY CustomerID
HAVING COUNT(*) = (SELECT COUNT(*) FROM Branches)

SQL Server Helper
How well do you know SQL? Find out with the free test assessment from SQL Server Helper!!!
http://www.sql-server-helper.com/free-test/default.aspx

Got a SQL Server Question? Ask us here: http://www.sql-server-helper.com/forums/default.asp
Reply With Quote