Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Question
Message
De
11/03/1999 06:45:50
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00196263
Message ID:
00196277
Vues:
36
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform