Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One to Many Join should return only 1 corresponding reco
Message
From
23/08/1999 08:56:30
 
 
To
20/08/1999 14:05:13
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00255979
Message ID:
00256527
Views:
25
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform