[thelist] SQL Help needed

Jay Greenspan jay at trans-city.com
Thu Jan 31 19:11:01 CST 2002


On Thursday, January 31, 2002, at 08:05 PM, Andrew Forsberg wrote:

> SELECT this, that, and, the_other
> FROM TableA
> ORDER BY paiduntil DESC, lastloggedon DESC
>
> I'm fairly sure the NULL paiduntil values should come last as a
> result of the first ORDER criteria. Could be wrong though.
>

If that doesn't work, you could use a UNION

SELECT a,b,c FROM tableA
WHERE paidunitl is not null
ORDER BY lastloggedon
UNION
SELECT a,b,c FROM tableA
WHERE paidunitl is null
ORDER BY lastloggedon

-j




More information about the thelist mailing list