Link to home
Start Free TrialLog in
Avatar of Smartin
SmartinFlag for United Kingdom of Great Britain and Northern Ireland

asked on

What does the "desc" do at the end of this sql statement

Howdy all,

Confused...  I have a view in SQL that orders my outbound call pot.  It was created for me by the software vendor.  Does anyone know what the "desc" does to the following:

ORDER BY dbo.Activity.IPCMPriority DESC, Start_date DESC, Start_Time

When I add a sort on a field it doesnt add it to the field name??

Regards...
ASKER CERTIFIED SOLUTION
Avatar of tigin44
tigin44
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Smartin

ASKER

DOH!!!!!  Think before speak  :)
ORDER BY dbo.Activity.IPCMPriority DESC, Start_date DESC, Start_Time

here in your example your result set is sorted from bigger value to the smaller value for the IPCMPriority column then sorted by the  Start_date from the newer date to the oldest date ...
ORDER BY would sort it ASC, DESC depending on what you specify. Default would be ASC.