Page 1 of 1

I'm trying to retrieve a record ORDER by id ASC...

Posted: Mon Aug 09, 2004 12:54 pm
by voltrader
I'm trying to retrieve a record ORDER by id ASC, but my field is of the form:

x0000000000

where x is a letter.

Is there a MySQL command to ignore the first letter? Or does MySQL already consider A2 to be bigger than A1?

Posted: Mon Aug 09, 2004 2:04 pm
by anjanesh

Code: Select all

SELECT id,SUBSTRING(id,2) AS id1
FROM `Table1`
ORDER BY id1

Code: Select all

SELECT GREATEST("A1","A2");
returns A2

Posted: Mon Aug 09, 2004 2:06 pm
by feyd
A2 would be sorted after A1

Posted: Mon Aug 09, 2004 11:50 pm
by voltrader
[SOLVED] Thanks for replies folks