List:General Discussion« Previous MessageNext Message »
From:Dirk Bremer \(NISC\) Date:May 12 2004 3:34pm
Subject:ORDER BY Question
View as plain text  
The following query produces the following results:

select job_coop as 'Job/Coop', count(*) as Count from queue group by
job_coop;

+----------+-------+
| Job/Coop | Count |
+----------+-------+
| B03013   |    19 |
| B05044   |     9 |
| B07037   |     6 |
| B15037   |     4 |
| B16032   |     6 |
| B17026   |     6 |
| B17056   |    18 |
| B18032   |     5 |
| B20009   |    31 |
| B21012   |     1 |
| B24026   |     8 |
| B25001   |    42 |
| B27043   |    10 |
| B27047   |     8 |
| B29064   |     6 |
| B31004   |    61 |
| B36035   |    60 |
| B36529   |    54 |
| B38023   |    38 |
| B38034   |     7 |
| B40020   |    30 |
| D18032   |    31 |
| D27047   |     2 |
| D31004   |    59 |
+----------+-------+

Is there a way to use the ORDER BY clause to order the results by the
numeric value of the count(*), i.e. so that the results would be sorted by
the result of the count(*)?

Dirk Bremer - Systems Programmer II - ESS/AMS  - NISC St. Peters
USA Central Time Zone
636-922-9158 ext. 8652 fax 636-447-4471

dirk.bremer@stripped
www.nisc.cc

Thread
ORDER BY QuestionDirk Bremer \(NISC\)12 May
  • Re: ORDER BY QuestionMichael Kruckenberg12 May
  • Re: ORDER BY Question(Johan Hook)12 May
  • Re: ORDER BY QuestionRhino12 May
  • Re: ORDER BY QuestionDirk Bremer \(NISC\)12 May
    • Re: ORDER BY Question(Johan Hook)13 May