I am trying to write a query that will sort results using one or two
substrings in item number. So for example I have item numbers that start
with SE0000, TS0000, N00000, W000000, etc.

So let say I want results sorted in the following order

TS0000, SE0000, N00000, W00000

I have tried the following in my query but it's not sorting properly:

ORDER BY FIELD(LEFT(item_number, 2) , 'TS'), FIELD(LEFT(item_number, 1)
'N','W')

Any suggestions. 

I am using MYSQL 3.23



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to