Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting the difference between two tables...

    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
    Last edited by romram; 05-20-2004 at 07:02 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts


    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.
    De gustibus non est disputandum.

  • #3
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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_***)
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •