Hi Anton,

Try this:

select State,City,Ifnull(Suburb,'') from tbl
Order By State,City,Ifnull(Suburb,char(255));

Anvar.

At 01:42 PM 23/01/2002 +0200, you wrote:
>database,sql,query,table
>
>
>
>Hallo All
>
>I have a select statement for 3 fields (State, City, Suburb) then I
>ORDER BY State,City,Suburb ASC
>
>The values gets sorted State --> City --> Suburb  in Asc. order
>
>The problem is that where Suburb is zero, no value  it gets placed at
>the top of the ordered list - I want any record where suburb happen to
>be zero placed at the bottom of the list and have it start from suburb
>a-z. Thus I will have :
>
>
>StateA1 -> CityA1 -> Suburba1
>StateA1 -> CityA1 -> Suburba2
>StateA1 -> CityA1 -> Suburba3
>StateA1 -> CityA1 ->
>StateA1 -> CityA1 ->
>StateB1 -> CityB1 -> Suburbb1
>StateB1 -> CityB1 ->
>StateB1 -> CityC1 -> Suburbc1
>StateB1 -> CityC1 -> Suburbc2
>StateB1 -> CityC1 ->
>
>IT STILL FOLLOWS THE State -> City Order rules
>
>Thanks
>
>
>
>
>
>
>---------------------------------------------------------------------
>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