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
    Aug 2006
    Location
    Sweden
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    select rows where field not in table

    I have three tables table1, table2 and a relation (* <-> *) btween the two - table3.
    to select rows from table1 i have:
    Code:
    SELECT table1.* FROM table1, table3 WHERE table1.field1 = table3.tbl1field1 AND table3.table2ID = 5
    // 5 is an example ID from table2
    How do I negate the result? Getting all rows that don't have an entry in table3 for table2ID = 5?

  • #2
    SSJ
    SSJ is offline
    Regular Coder
    Join Date
    Mar 2007
    Posts
    230
    Thanks
    0
    Thanked 4 Times in 4 Posts
    really didn't get what you want to say?
    Explain it more...

  • #3
    New Coder
    Join Date
    Aug 2006
    Location
    Sweden
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry... anyway I fixed it... I just had a black out there... what I looked for was WHERE x NOT IN (SELECT x FROM ....)


  •  

    Posting Permissions

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