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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: One sql statement

Re: One sql statement

From: Ferry Situmorang <binsar_at_kalimantan.ptpn13.com>
Date: Tue, 02 Apr 2002 18:58:18 -0800
Message-ID: <F001.004396DE.20020402185818@fatcity.com>


thankyou for help.

Ferry Situmorang:
Using Oracle 8.1.7 Designer 6i R4
PT Perkebunan Nusantara XIII (Persero)
Pontianak-Indonesia
http://www.ptpn13.com
----- Original Message -----
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> Sent: Tuesday, April 02, 2002 1:28 PM

> Select sum(decode(balance, 'D', amount, 0)) Db_Amt, sum(decode(balance,
'C',
> amount, 0)) Cr_Amt from ...
> HTH!
> Aleem
>
> -----Original Message-----
> Sent: Tuesday, April 02, 2002 10:58 AM
> To: Multiple recipients of list ORACLE-L
> Subject: One sql statement
>
> Suppose I have table structure like this:
> amount Numeric(10)
> balance VARCHAR(1)
>
> the balance column can only have one of 'D' or 'C'
>
> I want to sum the amount of Debet and Credit on ONE SQL statement.
> How my SQL statement should be?
>
>
> Ferry Situmorang:
> Using Oracle 8.1.7 Designer 6i R4
> PT Perkebunan Nusantara XIII (Persero)
> Pontianak-Indonesia
> http://www.ptpn13.com
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Ferry Situmorang
> INET: binsar_at_kalimantan.ptpn13.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Abdul Aleem
> INET: dmit_at_beaconhouse.edu.pk
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Ferry Situmorang
  INET: binsar_at_kalimantan.ptpn13.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Apr 02 2002 - 20:58:18 CST

Original text of this message

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