I'm retarded...this is the query you want for MySQL:

SELECT CONCAT( '0' + c ) AS value
FROM tmp
ORDER BY value

The previous wasn't sorted alpha by default...I'm just an idiot. The above
query though does return your desired result set:

1 
101 
101010 
2 
201 
201010 
201020 

-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 03, 2008 4:49 PM
To: CF-Talk
Subject: RE: Order by question

Paul...

What DBMS are you using? In MySQL 5, sorting a numeric column apparently
defaults to sorting alphabetically.

CREATE TABLE `tmp` (
  `c` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO tmp (c) VALUES (1);
INSERT INTO tmp (c) VALUES (101);
INSERT INTO tmp (c) VALUES (101010);
INSERT INTO tmp (c) VALUES (2);
INSERT INTO tmp (c) VALUES (201);
INSERT INTO tmp (c) VALUES (201010);
INSERT INTO tmp (c) VALUES (201020);

SELECT *
FROM `tmp`
ORDER BY c ASC


-----Original Message-----
From: Paul Ihrig [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2008 4:31 PM
To: CF-Talk
Subject: Re: Order by question

Gerald
they are nums in a num field
they sort correctly if i wanted them sorted like a number.
but powers that be want them sorted in a was to show hierarchy..

nm... i will tell them we can recreat the table with the order they want by
hand...





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302672
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to