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...
SmartinAsked:
Who is Participating?
 
tigin44Connect With a Mentor Commented:
it orders the result set in descending order... default is asc meaning ascending.
0
 
SmartinAuthor Commented:
DOH!!!!!  Think before speak  :)
0
 
tigin44Commented:
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 ...
0
 
sameer2010Commented:
ORDER BY would sort it ASC, DESC depending on what you specify. Default would be ASC.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.