TRY
 
SELECT DISTINCT Postcode,  Count(*) AS PopSubCount
...........
GROUP BY Postcode
ORDER BY PopSubCount DESC
 
 
PS does anyone know of a good mySQL list in or near this timezone?
 
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CFAussie Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, December 12, 2003 11:58 AM
Subject: [cfaussie] RE: Slight OT : MySQL Desc equivalent

just a stab in the dark, if I understand what your trying to do and MySQL supports it.

MAX()

PS. how about a MySQL mailing list, they would be more helpfull I guess?

-----Original Message-----
From: Andrew Dickinson [mailto:[EMAIL PROTECTED]
Sent: Friday, 12 December 2003 10:52 AM
To: CFAussie Mailing List
Subject: [cfaussie] Slight OT : MySQL Desc equivalent


More MySQL conversion fun.

I'm looking to convert this syntax to MySQL

SELECT DISTINCT TOP 1 Postcode,
Count(*) AS PopSubCount
...........
GROUP BY Postcode
ORDER BY Count(*) DESC

I've worked out that
"TOP 1" under select
needs to be replaced by
"LIMIT 1" at the bottom.

But what to do with the Count(*) DESC ?

I have tried
LIMIT 1
ORDER BY Count(*) DESC

and

ORDER BY Count(*) DESC
LIMIT 1

But they both come out as syntax errors.

Briefly, the purpose of this code is to extract the postcode where the
largest number of customers (that's what Count DESC is used for - to find
the largest number) are living, and then break it down for further
deomgraphic stats.


---
You are currently subscribed to cfaussie as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

---
You are currently subscribed to cfaussie as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to