Results 1 to 3 of 3

Thread: Easy SELECT question

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274

    Post

    In a Visual FoxPro DB (as BackEnd), I have two tables (T1, T2) with a 'ncontra' field in both tables.

    I want to select all 'T1.ncontra' which are not present in 'T2.ncontra'. This is.

    If ncontra = XXX exist in T1 but not exist in T2; select it. If ncontra = YYY exist in T1 and also Exist in T2; don't select it.

    Of course I was accesing from VB (as a FrontEntd)

    Thanks

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    A SQL statement to do what you want would be

    select ncontra from t1 where ncontra not in(select distinct ncontra from t2)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274

    Post

    Thanks a lot JHausmann!

    Ulises

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