Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2007

    Unanswered: Probably an easy JOIN. I but I don't know

    I'm trying to find records in the 'user' table that DO NOT have a record in the 'stuff' table. So basically the statement should only return record 3 from the user table since there is not record in the stuff table for it. I think it a join, but I'm second guessing my self. Can some one please assist me. Thanks in advance.

    uid name
    1 James
    2 Erick
    3 Todd

    userid thing
    1 car
    1 house
    2 mansion

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    select u.uid
      from user as u
    left outer
      join stuff as s
        on s.userid = u.uid
     where s.userid is null
    go Todd!! | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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