Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: help with a query
If I remember this correctly:
at sqlplus prompt enter
compute sum of sales on report
break on Year_of_sale
select to_char(date,'YYYY') Year_of_sale,sum(sales) group by to_char(date,'YYYY');
javadrink_at_my-deja.com wrote:
>Hi,
>
>Hope someone can help me with a query:
>
>I have the following table: table1, with 2 columns: sales, date
>
>what I want to do is:
>
>select and add the value of sales based on date:
>
>i.e.
>result will be:
>
>(sales in year 1998), (sales in 1999), (sales in 2000), (total sale)
>
>Can I do it in ONE query?
>
>Thanks a lot!
>
>
>
>Sent via Deja.com
>http://www.deja.com/
Received on Wed Jan 10 2001 - 16:00:10 CST
![]() |
![]() |