June 2, 2008 at 1:02 am
Hi
I'm having certain value like the following
01/jan 100
02/jan 200
03/jan 300
04/jan 400
How can I get a result like
01/jan 100 100
02/jan 200 300
03/jan 300 600
04/jan 400 1000
June 2, 2008 at 4:29 am
You can do this from the follwoing way
SELECT
Whereas:
1.table_name1 and table_name2 are the same table name. Use the alias
2.column_name1 is the datetime coulmn
-Satya
June 2, 2008 at 4:30 am
You can do this from the follwoing way
SELECT table_name1.column_name2 ,(select sum(table_name2.column_name2) from table_name2 where table_name2.coulmn_name1 <= table_name1.column_name1 ) as new_column from table_name1
Whereas:
1.table_name1 and table_name2 are the same table name. Use the alias
2.column_name1 is the datetime coulmn
-Satya
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply