SELECT ... FROM tablename ORDER BY varcharcolumn+0;


Gurhan

-----Original Message-----
From: Maksim Rogov [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 9:44 AM
To: [EMAIL PROTECTED]
Subject: Sorting a varchar field...


Hi, I am new to the list :)

Have a question, I have not been able to find any information on this on the
MySQL site.

Is it possible to sort a varchar field that contains numbers as an integer
field?

ie. right now it is sorting 1,2,4,10,11,12 as:

1
10
11
2
4

I would like to see it properly sorted. The reason the field is varchar is
because we may *sometimes* have string characters in the field.

Thanks for your help,

Maksim


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to