...

View Full Version : Getting the difference between two tables...



romram
05-20-2004, 06:40 PM
How can I use mysql query to get the difference between two pages???

SELECT * FROM
(SELECT stud_id FROM register_in)
EXCEPT
(SELECT stud_id FROM stud_***)

I used this one but I have the following massege:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT stud_id FROM register_in) EXCEPT (SELECT

mordred
05-21-2004, 09:44 AM
:confused:

There is no EXCEPT keyword in MySQL, and from your description it's not clear to me what you're trying to achieve. Can you give a more detailed example including what's in stud_*** and register_in, and what you result you want to get? Apart from that, I think you want to look at how table joins work.

raf
05-21-2004, 09:49 AM
Or maybe using a subquery (if your version is 4.1 or higher). Like

select var1, var2 from table where stud_id NOT IN (select stud_id from stud_***)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum