Home:ALL Converter>Why column with null value come before column with values when you order by a timestamp column in oracle 9i

Why column with null value come before column with values when you order by a timestamp column in oracle 9i

Ask Time:2011-11-08T20:39:56         Author:Nicola Peluchetti

Json Formatter

I've got a strange behaviour with an Oracle 9i database. If i make a query like this:

 select * from table order by dp_dt_timestamp DESC;

where dp_dt_timestamp is a timestamp column, rows which have null values in the column dp_dt_timestamp come before those that have a value.

How can i put the null values as the last values and still have the timestamps ordered Descending?

Author:Nicola Peluchetti,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/8050492/why-column-with-null-value-come-before-column-with-values-when-you-order-by-a-ti
yy