Ordering a varchar field in mysql

Ordering a varchar field in mysql

am 04.12.2007 06:42:40 von Vaibhav Informatics

------=_Part_12093_8220493.1196746960160
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

*Questions on PHP*



In one of our tables, one of the field is acc_no, we had given the data type
as varchar, since it could take any alpha-numeric values. In viewing this,
we used 'order by acc_no.' The sequence of records shown was
1,10,100,1000,A1, A10, A100, etc. whereas we want the sequence to be
1,2,3,4,etc. for all the numeric values followed by alpha-numeric values A1,
A2, A3, etc.



Can someone please give us the code for this type of ordering?


--
Vaibhav Informatics, 109 Vasant Plaza, Munirka, Near Subway, New Delhi-110
067 Ph: 011-26194466 Email :vaibhavinformatics@gmail.com

------=_Part_12093_8220493.1196746960160--