> A simple example > > Color Category Table > ID Name > 1 Red > 2 Blue > 3 Green > > Product Detail Table > ID Name Color > 1 Bike 1 > 2 Bike 2 > 3 Trike 1 > 4 Trike 2 > 5 Unicyc 1 > > I would run the query > > SELECT * > FROM Color LEFT OUTER JOIN Product ON Product.ID = Color.ID > WHERE Color.ID IS NULL
Shouldn't that be? SELECT * FROM Color LEFT OUTER JOIN Product ON Product.color = Color.ID WHERE Color.ID IS NULL > > This query would return no records, but the opposite. > > SELECT * > FROM Product LEFT OUTER JOIN Color ON Color.ID = Product.ID > WHERE Product.ID IS NULL And wouldn't this be? SELECT * FROM Product LEFT OUTER JOIN Color ON Color.ID = Product.color WHERE Product.color IS NULL Either way should return zero records based on the populated data in your example. Another check you could run would be to get all products from the product table, note the record count, then inner join product and color to see if the record count matches. Good luck, ~Dina ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6 Host with the leader in ColdFusion hosting. Voted #1 ColdFusion host by CF Developers. Offering shared and dedicated hosting options. www.cfxhosting.com/default.cfm?redirect=10481
