[dba-SQLServer] How to get top1 of group by

Arthur Fuller fuller.artful at gmail.com
Wed Jul 20 08:56:19 CDT 2011


Sorry, I misunderstood. To get what you want, you have to go "correlated
subquery". See this link for more info on setting this up:

http://msdn.microsoft.com/en-us/library/ms187638.aspx

HTH,
A.

On Wed, Jul 20, 2011 at 8:07 AM, jwcolby <jwcolby at colbyconsulting.com>wrote:

> No, that gets the top 1 of all the records.  The query is returning 1 to N
> records for every product.  I need 1 record for every product.
>
>
> John W. Colby
>
>



More information about the dba-SQLServer mailing list