Hello,

In PostGreSQL NULL values sort last. The following SQL statement will
sort them at the top:

SELECT * FROM <table> ORDER BY <col> IS NOT NULL, ORDER BY <col> ASC

or alternatively

SELECT * FROM <table> ORDER BY COALASCE(<col>,0) ASC
In this example NULLs are mapped to zero, i.e. one would choose the lowest possible value.



Result

<col>
-------------
NULL
12
13
16
18

How can this be done via Torque Criteria?

--


Regards/Gruß,

Tarlika Elisabeth Schmitz



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to