Re: mysql + PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2006/6/15, weetat <weetat.yeo@xxxxxxxxx>:

Hi all,

   I have SQL query , for example , Select country , name from
tbl_chassis order by country.

  The problem of the sql statement is that , if there are empty value in
country field , it be sorted first .

How to do sorting the empty value last
? I can cp() function to do this ? or any mysql function to use?

Thanks
- weetat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Maybe this will do the trick:

select country, name
 from tbl_chassis
order by country = '', country

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux