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!

SELECT nvl( count(*), 0 )

Avi AbramiAug 27 2007 — edited Aug 28 2007

Hi,
Found the following SQL query in some legacy code.

SELECT  nvl( count(*), 0 )
FROM    some_table
WHERE   some_condition

Since this is legacy code, I'm guessing it's been around since Oracle 7 and hasn't been touched since.
I have never seen "SELECT nvl( count(*), 0 )" before.
Can someone explain why it would be used?
Is there a difference between this construct and simply doing: select count(*)?

Thanks,
Avi.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2007
Added on Aug 27 2007
7 comments
10,023 views