[thelist] SQL Help needed

Andrew Forsberg andrew at thepander.co.nz
Thu Jan 31 19:04:00 CST 2002


>   What I have at the moment is
>
>SELECT * FROM TableA
>order by paiduntil, lastloggedon
>
>   Obviously the above statement is wrong.  Any help would be appreciated.

If I understand you correctly, I think you want:

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.

Cheers
Andrew

--
Andrew Forsberg
---
uberNET - http://uber.net.nz/
the pander - http://thepander.co.nz/



More information about the thelist mailing list