Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Default 'sum' to zero when recordset is empty ?

Default 'sum' to zero when recordset is empty ?

From: Richard Shea <rshea_at_my-deja.com>
Date: 16 Nov 2001 01:47:15 -0800
Message-ID: <43160f6f.0111160147.46c2fa67@posting.google.com>


Hi - I've got a view which looks like this :

SELECT TABLE_A.*,
(SELECT SUM(COLUMN_1) FROM TABLE_B WHERE COLUMN_2 = TABLE_A.COLUMN1) MYPROBLEMTOTAL
FROM TABLE_A My problem is that when inner select produces no records the value MYPROBLEMTOTAL is NULL. It would be much better if I could in some way make it equal to zero in this case. Can anyone explain to me the best way to do this ?

thanks

richard shea
rshea_at_my-deja.com Received on Fri Nov 16 2001 - 03:47:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US