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

jwcolby jwcolby at colbyconsulting.com
Thu Jul 21 14:52:04 CDT 2011


Making matters much worse, they have SQL Server 2000.

John W. Colby
www.ColbyConsulting.com

On 7/20/2011 9:56 AM, Arthur Fuller wrote:
> 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
>>
>>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
>



More information about the dba-SQLServer mailing list