I hae two tables, related to each other by order id.
I need to find out programatically what orders exist in the main table
without any corresponding lines in the other table based upon the
relationship of the order id.
How can I do a SQL query in which I ask during the join for what does not
exist specifically? Left join, for example, gives me everything; record or
not. Right join would be only if something exists in that second table...
Must be easy, but I can't figure it out.
Thanks!
from #request.cust_table# cu
JOIN #request.orders_table# co on co.customer_id =
cu.cust_id
<cfif url.errorid NEQ 4>
RIGHT OUTER JOIN #request.hold_table# ht on ht.order_id =
co.corder_id
<cfelse>
<!---here....give me what specifically does not have a
record in the other table--->
LEFT OUTER JOIN #request.hold_table# ht on ht.order_id =
co.corder_id
Eric
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:221506
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