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!

How to return 0 on max function when no rows found

971819Oct 31 2012 — edited Nov 1 2012
Hi everyone!

I am using a max fuction, but I want that the function return 0 if there are not rows that match with the conditions.

I was thinking in something like this

SELECT nvl(max(salary),0)

But it doesn't work, it doesn't show the value 0

Please someone can give and idea
Thanks a lot.
This post has been answered by Frank Kulash on Oct 31 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2012
Added on Oct 31 2012
8 comments
6,646 views