Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Question
Message
From
11/03/1999 06:45:50
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00196263
Message ID:
00196277
Views:
29
>Hello All,
>I need to select some records from a table that are not present in another table, I've heard you can do this with one of the outer joins but am unsure as to how
>
>Regards
>Pete Kane
Pete,
Different strategies depending on what you want :
- Both existing and none existing in table2 -> outer join

select * from mytable ;
left join table2 ;
on mytable.linkexpression = table2.linkexpression
* Table2 fields would be .NULL. for those that do not exist in table2
* All recs from mytable (left table) would be in final cursor

- Only those not in table2 -> subquery
select * from mytable ;
where linkexpression not in ;
(select distinct linkexpression from table2)

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform