Re: COUNT = 0

From: Joanne Woytek <joanne_at_eosdev1.gsfc.nasa.gov>
Date: 1995/08/16
Message-ID: <40snqn$58t_at_post.gsfc.nasa.gov>#1/1


In article <15AUG199512343590_at_cc.weber.edu> ylew_at_cc.weber.edu (Yee Lew) writes:
>In article <40qh10$i23_at_post.gsfc.nasa.gov>, joanne_at_daac.gsfc.nasa.gov (Joanne Woytek ) writes...
>>I'd like to have a 0 appear from my sqlplus statement when count(*) is zero.
>>CUrrently it just shows a blank:
>
>I just tried it on a 7.1.4 RDBMS on a table with no rows and it returns a
>zero. Odd behavior you have, since I thought a COUNT(*) always returns a
>value. In your case, have you tried NVL(COUNT(*), 0)?

As I noted in an earlier post the problem turned out to be: set numformat 9990. My guess is this is the default - I have a set numformat 99999999 in my login.sql startup script so I was overriding the default.

The nvl(count(*),0) idea seemed like a logical thing to try (and I had several people suggest it), so I just wanted to note that NVL had no effect.

Joanne Woytek
joanne_at_daac.gsfc.nasa.gov Received on Wed Aug 16 1995 - 00:00:00 CEST

Original text of this message