Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
select top 10 records from multiple tables order by desc like below:
1] top 9 records
2] sum of left of records as single records
Posted
Comments
Mahendra.p25 8-Apr-11 3:44am    
Please Elaborate

1 solution

You didn't give much to work with, but a structure like this could work:
SELECT SUM(...), ...
FROM (SELECT TOP(10)
        CASE WHEN ROW_NUMBER() OVER (...) = 1 THEN 'Set 1'
             ELSE 'Set 2'
        END AS SetID,
        ...
      FROM ...
      ORDER BY ...) A
GROUP BY A.SetID
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900