#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    44
    Rep Power
    15
    Very similar to selecting only those values in table1 that exist in table2 also, I want to select all those that exist in table1 but NOT in table 2.

    I have no clue how to do this. I tried:

    select table1.ID from table1, table2 where table1.ID <> table2.ID

    but that does not work because it simply returns the rows in the reversed order.

    select table1.ID from table1, table2 where table1.ID = table2.ID works for the opposite effect. (finding all rows where the value is same in the first and second table)
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    You won't be able to do it in one query (until MySQL supports sub-selects).
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 1999
    Location
    euless, texas, usa
    Posts
    3
    Rep Power
    0
    The answer posted here is incorrect - this is a standard LEFT JOIN query. see the other thread with this same topic at http://www.devshed.com/Talk/Forums/F...ML/003301.html
  6. #4
  7. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    I shouldn't answer posts before I've had my morning coffee....

Similar Threads

  1. select verification onsubmit
    By DrStein in forum HTML Programming
    Replies: 3
    Last Post: January 20th, 2004, 03:16 AM
  2. Replies: 4
    Last Post: December 8th, 2003, 10:57 AM
  3. Help with javascript, passing multiple select array to js then php
    By zen^Wallhack! in forum JavaScript Development
    Replies: 1
    Last Post: December 3rd, 2003, 01:56 PM
  4. Replies: 2
    Last Post: December 2nd, 2003, 03:06 AM
  5. Help with function to copy contents of select item
    By MilesDependent in forum HTML Programming
    Replies: 2
    Last Post: November 23rd, 2003, 06:16 PM

IMN logo majestic logo threadwatch logo seochat tools logo