Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compound PK
Message
De
24/01/2003 18:47:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
24/01/2003 18:41:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00745314
Message ID:
00745317
Vues:
16
>Hello, everyone
>
>It's about a MSSQL2k database. Some of the tables (used as junction tables) don't have a PK, but a compound pk, on two columns. My problem is now I have to find which records are in one table and aren't in another. This is a good candidate for a subselect
>
select pk from table1 where pk not in (select pk from table2)
>. Well... I have two columns. How to say that? select col1,col2 from table1 where pk1,pk2....somebody stop me, I'm already laughing :0
>
>
>Seriously, can anyone help me in this issue? (changing the tables is out of question)
>
>Thank you.

In VFP, one way to do this would be combining the two fields into one - but I don't know how to do this with SQL Server.

You can of course bring all the data over to VFP cursors first.

I don't know whether SELECT - SQL subqueries allows for this case explicitly.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform