Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Statement Help
Message
From
14/03/2001 12:59:50
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00484934
Message ID:
00484965
Views:
17
>>What is the syntax for a select statement where I want to select all the records in table1 that don't exist in table2
>>
>>Thanks
>
>You can use a simple subquery.
>select t1.* from table1 t1 where t1.key not in (select t2.key from table2 t2)
>If your definition of existing is based on multiple fields, you can concatenate them in your subquery.
>select * from table1 t1 where t1.field1+t1.field2+t1.field3 not in ;
>   (select t2.field1+t2.field2+t2.field3 from table2 t2)
>If the fields are not the same datatype, you can use transform() to convert them to character.
>
>HTH.

SWEET, Thanks a bunch, I'll give it a whirl :)
Thanks
Jon
Non-MVP Non-MCP Non-MCSE

Visual FoxPro, What else is there?
Previous
Reply
Map
View

Click here to load this message in the networking platform