Re: Problems with views and SUM

From: Srinivasa Kunamneni <eleeb02_at_menudo.uh.edu>
Date: 1996/07/06
Message-ID: <4rkbck$4lj_at_masala.cc.uh.edu>#1/1


Frederic Rivalland (frivalla_at_terre.univ-lr.fr) wrote:

: Hi
: I ve got a problem with a SELET from a VIEW.
: I ve create a view like :
 

: create or replace view CUMUL_DEB ( exer,dates,debit) as
: select j.jou_exer,j.jou_date, sum(e.ecr_mont)
: from journal j , ecriture e
: where j.jou_ordre = e.ecr_ordre
: and j.jou_type <> 'A'
: and ecr_sens = 'D'
: group by j.jou_exer,j.jou_date;
 

: it s ok ,i ve got rigth result :
:
: SQL> desc CUMUL_DEB
: Name Null? Type
: ------------------------------- -------- ----
: EXER VARCHAR2(2)
: DATES DATE
: DEBIT NUMBER

: SQL> select * from CUMUL_DEB;
 

: EX DATES DEBIT
: -- --------- ----------
: 95 02-JAN-95 2071.07
: 95 03-JAN-95 31617635.6
: 95 04-JAN-95 11859125
: 95 05-JAN-95 18489.99
: ...
 

: My Problem is that when i do a sum with the field DEBIT i lost
: informations (decimal) :
 

: SQL> select exer, sum(debit)
: from CUMUL_DEB
: where exer = 96
: and dates < sysdate
: group by exer;
 

: EX SUM(DEBIT)
: -- ----------
: 96 291787806
:
: I will try 291787806.XX
 

: I am looking for some help, thanks.
 

: FRED.
 
: --
: ___________________________________________________________________
: Frederic RIVALLAND
: Centre de Ressources Informatiques
: Universite de La Rochelle

        You have to format value to see all the decimals. Try:

        column format DEBIT 999,999,999.99

: SQL> select exer, sum(debit) DEBIT
: from CUMUL_DEB
: where exer = 96
: and dates < sysdate
: group by exer;

Hope it helps.
Srini Kunamneni Received on Sat Jul 06 1996 - 00:00:00 CEST

Original text of this message