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?
Your order by clause should be as follows:
desc
order by <field_name> desc nulls last;
asc
order by <field_name> asc nulls last;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With