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

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

(SELECT stud_id FROM register_in)
(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

05-21-2004, 10:44 AM

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.

05-21-2004, 10: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_***)