Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
vermorel
Starting Member
26 Posts |
Posted - 2006-11-30 : 07:55:27
|
| I have a query that include a single LEFT JOIN. I would like to be able to select at most 1 row of the second table (providing that the JOIN represents a one to many relationship).Does anyone knows how to do that?Thanks in advance,Joannès |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-30 : 07:58:28
|
| 1) Derived table2) Correlated subquery3) GROUP BY using MIN or MAXPeter LarssonHelsingborg, Sweden |
 |
|
|
vermorel
Starting Member
26 Posts |
Posted - 2006-11-30 : 08:30:46
|
| Thanks, GROUP BY + MIN does the trick.Best regards,Joannes |
 |
|
|
|
|
|