They'll normally sort at the top, unless you use ORDER BY DESC.
Anyway, fixing that is easy:
SELECT col1, col1 IS NULL AS isnull
FROM tbl1
ORDER BY isnull DESC, col1 ASC
That should give you the results ordered by col1, with the null-values
at the top.
- Martijn
On Sat, Apr 18, 2009 at 19:54, David M. Karr <davidmichaelkarr@stripped> wrote:
> I think normally NULL values will sort at the end, correct? I believe
> there's a way to make NULL values sort at the beginning, but I can't
> remember how to do it. I just searched a couple of MySQL resources, but I
> couldn't find it.
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
>
>