Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: A SQL select statement
Try this:
select item,to_char(actiondate,'Month) Month,sum(amount)
from Ledger
group by item,to_char(actiondate,'Month')
Should work...
HTH "Jingyan" <jingyan.xu_at_tst2000.com> wrote:
>Hi,
>the Ledger table below: I need to write a select statement to show the
>monthly amount paid for each item. Thanks for help. Jingyan Xu
>Name Null? Type
>------------------------------- -------- ----
>ACTIONDATE DATE
>ACTION VARCHAR2(8)
>ITEM VARCHAR2(30)
>QUANTITY NUMBER
>QUANTITYTYPE VARCHAR2(10)
>RATE NUMBER
>AMOUNT NUMBER(9,2)
>PERSON VARCHAR2(25)
>
>
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==---------- http://www.newsfeeds.com The Largest Usenet Servers in the World! ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==----- Received on Thu Oct 14 1999 - 13:58:51 CDT