For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > June 2006 > RE: [PHP-DB] re: mysql ORDER BY problems









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] re: mysql ORDER BY problems
Dwight Altman

2006-06-19, 7:01 pm

I believe I did this one time without changing the database schema; simply
by just putting the type in the ORDER BY clause.

Something like
ORDER BY BINARY numbers ASC
or maybe
ORDER BY CAST(numbers AS BINARY) ASC

Regards,
Dwight

> -----Original Message-----
> From: J. Alejandro Ceballos Z. -JOAL-
> [mailto:buzon@alejandro.ceballos.info]
> Sent: Sunday, June 18, 2006 7:01 PM
> To: php-db@lists.php.net
> Cc: rob@fiberuplink.com
> Subject: [PHP-DB] re: mysql ORDER BY problems
>
> are they defined as integer or varchars (string)?
>
> try
> a) exchange field definition varchar / integer
> b) order by length(number) and later by number
>
> --

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com