Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Default 'sum' to zero when recordset is empty ?
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
![]() |
![]() |