[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

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...
0
Smartin
Asked:
Smartin
  • 2
1 Solution
 
tigin44Commented:
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

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now