DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: using not exist

Hybrid View

  1. #1
    Join Date
    Jun 2002
    Posts
    17

    Exclamation using not exist

    I want to rewrite this query with not exists.

    select field_1 from table_1
    where fields_1 not in (select distinct field_1 from table_2)
    Thanks

  2. #2
    Join Date
    May 2002
    Location
    California, USA
    Posts
    175

    Smile

    Try that:

    select field_1 from table_1
    where not exists (select distinct field_1 from table_2 where table_1.field_1 = table_1.field1)


    Hope that helps,

    clio_usa - OCP 8/8i/9i DBA

    Visit our Web Site

  3. #3
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    I guess it's a typo

    where table_1.field_1 = table_2.field1


  4. #4
    Join Date
    May 2002
    Location
    California, USA
    Posts
    175

    Smile

    It's. Why they always give us so short lunch breaks ???

    Thanks for the correction. I will double check the code, before posting it next time.


    Hope that helps,

    clio_usa - OCP 8/8i/9i DBA

    Visit our Web Site

Posting Permissions

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


Click Here to Expand Forum to Full Width