Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: NULLS FIRST option in CREATE INDEX?
"Maximus" <qweqwe_at_qwqwewq.com> wrote in message news:<L26Ea.142907$3C2.4666777_at_news3.calgary.shaw.ca>...
>
> Why not just UNION ALL two selects together? This example will give you
> nulls first without doing a sort:
>
> select * from table where key_expr is null
> union all
> select * from table where key_expr is not null
Thanks...but such a union will not give me the desired order of rows. Consider the following rows:
col1 col2 ---- ---- A NULL B NULL A abc B abc
The order produced by your SQL will be the same as the above. But the order desired by my SQL ("order by col1, col2 nulls first") as described earlier is:
A NULL A abc B NULL B abc
Alanoly. Received on Mon Jun 09 2003 - 07:30:14 CDT