Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase «««123

T-SQL - SELECT TOP Expand / Collapse
Posted Thursday, March 19, 2009 11:13 AM



Group: General Forum Members
Last Login: Today @ 12:23 PM
Points: 23,522, Visits: 37,757
Yes, there are issues with the query itself, but what did the question ask? How do you ensure you get the top 25 in sales. The only answer that works there is that you also need to add an ORDER BY SUM(salesdollars) DESC.

Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #679688
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse