Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Ascending and Descending Orders

Author  Topic 

Praetorian
Starting Member

3 Posts

Posted - 2013-11-08 : 16:21:53
Hi all. Ron here. I hope everyone is doing well. I'm OK but for a small problem understanding an assignment I've been given. You see, in the directions for a given problem, the instructor ask that the results be sorted with "the count column in descending order and name in ascending order." However, in the "results should look like this" document she sent out, I can see no order to the name column. Is there something I'm missing. If anyone can help point me in the right direction, I would appreciate it very much. Below is the desired output:

CUSTOMER# Name COUNT(*)
---------------------- --------------------- ----------------------
1001 BONITA MORALES 2
1003 LEILA SMITH 2
1005 CINDY GIRARD 2
1007 TAMMY GIANA 2
1010 JAKE LUCAS 2
1018 GREG MONTIASA 2
1020 KENNETH FALAH 2
1004 THOMAS PIERSON 1
1008 KENNETH JONES 1
1011 REESE MCGOVERN 1
1014 JASMINE LEE 1
1015 STEVE SCHELL 1
1017 BECCA NELSON 1
1019 JENNIFER SMITH 1

Praetorian
Starting Member

3 Posts

Posted - 2013-11-08 : 16:40:43
My question is this: can anyone see any 'sort' or order to the name column?
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-11-08 : 16:56:14
I don't see an order on the Name in the data you provided; Only an order by the COUNT(*) and then the Customer#.
Go to Top of Page

Praetorian
Starting Member

3 Posts

Posted - 2013-11-08 : 17:03:32
Thanks Lamprey. I don't see any order to the Name data either. But the above list is what she expects our results to look like. My results look similar, in that the count is descending. Otherwise I don't see anything I can do with the names. (The names on my list are not in the same order.)
Go to Top of Page
   

- Advertisement -