Home » SQL & PL/SQL » SQL & PL/SQL » urgent - getting in month and upto month figures in the same query
urgent - getting in month and upto month figures in the same query [message #20776] Wed, 19 June 2002 22:33 Go to next message
balky
Messages: 2
Registered: June 2002
Junior Member
how can one retrieve in month and upto month cumulative values in the same sql statement.
Re: urgent - getting in month and upto month figures in the same query [message #20830 is a reply to message #20776] Mon, 24 June 2002 08:12 Go to previous message
Wijnand
Messages: 11
Registered: March 2002
Junior Member
how can one retrieve in month and upto month cumulative values in the same sql statement.

select
a.month,sum(a.sales),sum(b.sales)
from
monthlysales a,
monthlysales b
where a.month >= b.month
and a.year = b.year
and a.year = 2002
group by a.month

note that a and b are one and the same table.
Previous Topic: ORA-2287 sequence not allowed here
Next Topic: who is expert in sql\plsql
Goto Forum:
  


Current Time: Tue Apr 23 20:41:45 CDT 2024