Oracle - Order by column with NULL values in last position

Ramesh

I am using Order by for records sorting. I want to select NULL records at last position in every sorting. Eg.

ASC - {1,2,3,4,5,6,7,NULL,NULL,NULL} 
DESC - {7,6,5,4,3,2,1,NULL,NULL,NULL}

How to do this in Oracle query?

Shann

Your order by clause should be as follows:

desc

order by <field_name> desc nulls last;

asc

order by <field_name> asc nulls last;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Oracle - Order by column with NULL values in last position

From Dev

Oracle order NULL LAST by default

From Dev

mysql order by field with NULL values last

From Dev

Why does this SQL order null values last?

From Dev

Doctrine 2 Order By ASC and Null values in last

From Dev

Why does this SQL order null values last?

From Dev

Sort values in two column and insert order position into another column in mysql

From Dev

Fill null values with last non-null amount - Oracle SQL

From Dev

oracle sql - Select ONLY if there are NO null values in that column

From Dev

PostgreSQL: order by column, with specific NON-NULL value LAST

From Dev

Multiple order by and null values to be ordered using next fields not to be first or last

From Dev

ORDER BY null position

From Dev

In which order Oracle SQL update statement changes column values?

From Dev

mysql- sort list based on empty and null values as last in column

From Dev

How to order a query by column if some of its values are null?

From Dev

MySQL Update null column values incrementally in time order

From Dev

Oracle column order (dynamically?)

From Dev

Oracle function to distinct NULL values based on other column

From Dev

Order by NULL values with mysql

From Dev

Order column by the last letter in the records

From Dev

Modify column values to that they are in order

From Dev

Oracle Constraint and null values

From Dev

Oracle Index - For null values

From Dev

Oracle Query with null values

From Dev

PostgreSQL ORDER BY column position (and not by column name)

From Java

FIRST & LAST values in Oracle SQL

From Dev

Swapping column values in Oracle

From Dev

Replace values in column with Oracle

From Dev

aggregating column values oracle

Related Related

HotTag

Archive