Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One to Many Join should return only 1 corresponding reco
Message
De
23/08/1999 08:56:30
 
 
À
20/08/1999 14:05:13
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00255979
Message ID:
00256527
Vues:
23
>select distinct A.field1, B.field4, B.field5 from A, B where A.field1 = A.field3
>
>I get:
>
>field1 field4 field5
>0001 abc 01
>0001 abc 02
>0002 cde 11
>0002 cde 12
>0002 cde 13

Remove b.field5 from the above query and you should be the results that you're looking for.

SELECT DISTINCT a.field1, b.field4
FROM a INNER JOIN b ON a.field1 = b.field3

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform