Hi,

I have 3 tables that I want to get information out of in 1 query. The
problem is that 2 of the tables may or may not have information in them. All
3 tables have a relationship called contact_id. How do I do a query that
checks to see if table 2 has the same id as table 1 and table 3 has the same
id as table 1? I hope that makes sense because I have totally confused
myself with this one (not very hard to do:). This is a sample query..


<cfquery datasource="mydb" name="TheName">
SELECT *
FROM contacts,image_list,coupons
WHERE contacts.contact_id = image_list.contact_id
AND     contacts.contact_id = coupons.contact_id
</cfquery>

Now the AND will not work because image_list or coupons could have 0 records
with that id.

Any thoughts?

Phil




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185458
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to