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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Join problem

Author  Topic 

skillile
Posting Yak Master

208 Posts

Posted - 2001-11-01 : 11:31:10
I am pulling my hair out.

I have these tables:

company profile
usercustomer
orders table
address of orders

Inside the companies table I have all customer companies and
all of my branches. CID is the key for the co. ID

I want to see all orders for a specific [customer company] with the
customer companies address that is associated with the branch .


CID 11 = the branch I want to see
CCID is in customer company table relates back to CID in comp prof


Here goes:

SELECT a.compname,
b.fname + ' ' + b.lname as fullname,
c.OID
FROM tblcompprof a
INNER JOIN tblusercust b ON a.CID=b.CCID
INNER JOIN tblorder c ON b.CTUID=c.CTUID
INNER JOIN tblproperty ON "HELP HERE"
WHERE c.MCID=11

any help appreciated


slow down to move faster...
   

- Advertisement -