angelshark
MIS
Hello,
I would like to restrict the output of my query to the last 10 records.
I have used the TOP option with SORT BY DESC but it outputs the last records first.
I know that a way to get the last records last is by using a sub-query or a view but i've been having some trouble with those.
Here's my query :
I haven't been able to create a sub-query to get the results I need.
Would you help me building my sub-query?
Thanks for your help.
I would like to restrict the output of my query to the last 10 records.
I have used the TOP option with SORT BY DESC but it outputs the last records first.
I know that a way to get the last records last is by using a sub-query or a view but i've been having some trouble with those.
Here's my query :
Code:
SELECT TOP 10 SUM(Sys_used) + SUM(isnull(App_used,0.0)) + SUM(isnull(Data_used,0.0)) + SUM(isnull(Log_used,0.0)), Week FROM diskusage WHERE Category = '$categ' GROUP BY Week ORDER BY Week DESC
I haven't been able to create a sub-query to get the results I need.
Would you help me building my sub-query?
Thanks for your help.