Let me ask you one more. What I really wanted to do is sumation with decode, in Oracle,like this
CREATE TABLE BS1( iDATE DATE, iCode Varchar2 , amount number );
* iCode is the one to distinguish revenue and expenditure,for example,'A%%%' is of revenue and 'B%%%' for expenditure.
IF I want to retrieve a total amount of income and outgo within a period
> SELECT iDATE, sum(decode(substr(iCode,1,1),'A',amount,0)) INCOME,
> sum(decode(substr(iCode,1,1),'B',amount,0)) OUTGO
> FROM BS1
> Where idate BETWEEN d1 AND d2
> GROUP BY iDate
Then how can I make it the same with 'CASE' sentence? Oh! I forgot to thank you and please understand my Oracle-only environment.
-Jae-
OCP8 DBA