Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is Null highest or lowest value? using Least function..

2776946May 18 2015 — edited May 18 2015

So Null is one of the if not the highest value in a list of values.

Whenever i order by some column, null has always been the highest.

However when I use the least function

select * from invoices order by terms_of_discount desc;

select LEAST('2', '5', '12', '3', null) from dual;

select LEAST('apples', 'applis', 'applas', null) from dual;

In both cases null is the lowest

so i'm wondering why this is.

As oradocs mention:

DESCRIPTION

The Oracle/PLSQL LEAST function returns the smallest value in a list of expressions.

This post has been answered by John Stegeman on May 18 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2015
Added on May 18 2015
3 comments
2,239 views