Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TOP 10 within a group
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00913710
Message ID:
00913738
Vues:
15
Thanks Sergey. I will give it a try. I appreciate your time.


>Fred,
>Try
>SELECT suppliercode, productcode, dollarsales
>	FROM mytable mt1
>	WHERE dollarsales IN (
>		SELECT TOP 10 dollarsales
>			FROM mytable mt2
>			WHERE mt2.suppliercode = mt1.suppliercode
>				AND mt2.productcode = mt1.productcode
>			ORDER BY dollarsales DESCENDING)	
>
>
>>I have a table with suppliercode,productcode,dollarsales
>>
>>I want the top 10 product codes for each suppliercode. Is this possible
Fred Besterwitch, MCP

The harder you work. The luckier you get.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform