PDA

Click to See Complete Forum and Search --> : Easy SELECT question


Tonatiuh
Sep 30th, 1999, 12:39 AM
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

JHausmann
Sep 30th, 1999, 02:17 AM
A SQL statement to do what you want would be

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

Tonatiuh
Sep 30th, 1999, 05:02 AM
Thanks a lot JHausmann!

Ulises