SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Select All Items In Tabel A That Are Not In Table B???

Hybrid View

  1. #1
    Quake 1 Addict CreedFeed's Avatar
    Join Date
    Feb 2002
    Location
    Milwaukee, WI
    Posts
    294
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Select All Items In Tabel A That Are Not In Table B???

    ok I have two tables A and B, each with a field "id"... I want to select all ids from table A that are not in table B... how can this be done with a single query?
    -- Steve Caponetto
    Quake 1 Resurrection :: CreedFeed

  2. #2
    SQL Consultant silver trophybronze trophy
    SitePoint Award Recipient r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    38,470
    Mentioned
    35 Post(s)
    Tagged
    1 Thread(s)
    Code:
    select A.id
      from A 
    left outer
      join B
        on A.id
         = B.id
     where B.id is null
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

Bookmarks

Posting Permissions

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