Example
-------
My table already contains
Col1 Col2
---- -----
a 8
b 6
c 10
d 12
e 20
In my query output I want to show the data like this format
Col1 Col2 Col3
---- ----- ----
a 8 8 (Average of 1st row) means 10/1
b 6 7 (Average of 1st + 2nd rows) means (8+6)/2
c 10 8 (Average of 1st + 2nd + 3rd rows) means (8+6+10)/3
d 12 9 (Average of 1st + 2nd + 3rd + 4th rows) means
(8+6+10+12)/4
e 20 11.2 (Average of 1st + 2nd + 3rd + 4th + 4th rows) means
(8+6+10+12+20)/5
I hope it will be clear to all of you.If any problem in understanding
please let me inform.
Thanks
Arijit Chatterjee
You can use windowing functions:
select col1, col2, avg(col2) over (order by col1)
Good luck,
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
Thanks Lan Your answer is working perfectly.
Arijit Chatterjee