The left outer join appears to have done the trick! 
Thanks!
Dave
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 9:19 AM
To: CF-Talk
Subject: Re: SQL Join - Help!


Quoting "Bosky, Dave" <[EMAIL PROTECTED]>:
> 
> I'm trying to look up the department name and group description using
their
> ID's.
> But it only returns the records where it finds both department and group
> descriptions. Some records don't have a group description or department
name.
> I believe I'm using the wrong type of join but I'm stumped. Any ideas or 
> better ways of accomplishing this query.
> 
> SELECT  A.DepartmentID, A.AdminName, A.GroupID, B.DepartmentName,
> C.Description
> FROM DeptAdmin A
> INNER JOIN Dept B ON A.DepartmentID = B.DepartmentID
> INNER JOIN DeptGroups C ON A.GroupID = C.GroupID

SELECT  A.DepartmentID, A.AdminName, A.GroupID, B.DepartmentName,
C.Description
FROM DeptAdmin A
LEFT JOIN Dept B ON A.DepartmentID = B.DepartmentID
LEFT JOIN DeptGroups C ON A.GroupID = C.GroupID

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to