You more than likely need something similar to this, but keep in mind I am not
a SQL Guru!!
SELECT f.sub_object, p.title, p.sku
FROM menu_table f, product_table p
WHERE p.id not in(select sub_object from menu_table)
Douglas Brown
Email: [EMAIL PROTECTED]
----- Original Message -----
From: "Paul Giesenhagen" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, July 10, 2002 10:02 AM
Subject: OT: SQL checking query
> Hello folks,
>
> I have an easy one I am sure...
>
> I am trying to build a query that will show all items that are not
found......
>
> Two tables:
>
> Product Table
> id, title
>
> Menu Table
> id, owner, sub_object
>
> I want to write a query that will find all product IDs in the product table,
that are not found in either the owner OR the sub_object columns in the menu
table.
>
> (looking for orphan records, that are not found anywhere in the menu table).
>
> Any suggestions, here is what I have so far!
>
> SELECT f.sub_object, p.title, p.sku
> FROM menu_table f, product_table p
> WHERE p.id = f.sub_object
> OR p.id = f.owner
> AND f.type = 'product'
> AND f.sub_object NOT IN ('p.id')
> AND f.owner NOT IN ('p.id')
>
> Obviously this query doesn't work .. i have completely mangled it trying to
get the products that cannot be found in the menu.
>
> Any help is greatly appreciated!
>
> Paul Giesenhagen
> QuillDesign
>
>
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists