Hi all,
I have two database tables that should have the same number of values in them, but one has one value too many.
I need to find a query which can tell me which one is not in both tables.
Can anyone tell me how to do this?
The value which should match for both is category_id
Thanks
Find the odd one out - Urgent
Moderator: General Moderators
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Hmmm.
Code: Select all
SELECT * FROM table, table2 WHERE table1.value <> table2.valuehttp://forums.devshed.com/archive/t-44647 might help
Code: Select all
SELECT big_table.*, small_table.* FROM big_table LEFT JOIN small_table ON big_table.id = small_table.id WHERE small_table.id IS NULL