Don't even need csite in that query then.  Just write it like this:

SELECT cp.payid, cp.name, cp.url, #url.id# as [id]
FROM cpay cp
LEFT OUTER JOIN cpayment p
ON cp.payid = p.payid


-----Original Message-----
From: Paul Giesenhagen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 03, 2003 9:42 PM
To: CF-Talk
Subject: OT: Outer Join


I am having trouble with a query (which I am sure is simple).

Query:
SELECT cp.payid, cp.name, cp.url, c.id
FROM cpay cp
LEFT OUTER JOIN cpayment p
ON cp.payid = p.payid
INNER JOIN csite c
ON c.id = p.id
WHERE c.id = #url.id#

What I need is to have all of the CP.PAYID records show up, if the URL.ID
value is 0 (no records with ID 0) then I just want to have the whole list of
cp.payid's display with c.id as NULL ... if the ID is valid, I STILL want to
have the whole list of cp.payid's displayed, but with the c.id loaded with
the url.id.

Where am I missing this ...

Thanks folks

Paul Giesenhagen
QuillDesign



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

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

Reply via email to