select * from MyTable
order by case when b is null then 0 else 1 end, b

On Sun, Apr 19, 2009 at 3:53 PM, January Weiner <janu...@uni-muenster.de>wrote:

> Hello,
>
> default sorting with ORDER BY puts the NULL values at the beginning.
> How can I change this behaviour? I.e., instead of
>
> a       b
> -----   ----
> x      NULL
> y      0
> z      2
>
> I would like to have
>
> a      b
> ----    ----
> y      0
> z      2
> x      NULL
>
> Explanation: I have a table with e-values (expected number of
> something). A lower e-value means a more significant search hit. No
> evalue at all means that hit was not found, so that the missing
> e-values should be reported at the end (unfortunately, I want to have
> them reported, but just not at the beginning).
>
> Thank you in advance,
>
> j.
>
> --
> ---------Dr. January Weiner 3  -----------------+-------------------
> Inst. of Bioinformatics, UKM, Univ. of Muenster | Von-Esmarch-str. 54
> (+49) (251) 83 53002                            | D48149 Münster
> http://www.compgen.uni-muenster.de/             | Germany
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
-- Stevie-O
Real programmers use COPY CON PROGRAM.EXE
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to