Hi
I need some suggestions from you experienced programmers
I have the table with the fileds Sno,Close,Avg
after 10 th row i have to find avg of all closes form 1 to 10 and display as avg colum
in 12 th row i have to discard the colum value of close 1 and find the avg of close from 2 to 11
13 th row i have to discard the colum value of close 2 and find the avg of close from 3 to 12
when i am inserting the new row in the table ,i have to find the avg of 10 closes from this close value
like so on --------------------------------
fro eg
Sno close avg
1 11 null
.
;
,
.
10 123 null
11 231 avg(close(1 to 10)
12 211 avg(close(2 to 11)
13 123 avg(close(3 to 12)


i tried with one query
SELECT AVG(CLOSE1) FROM STACK WHERE SNO >(SELECT MAX(SNO)-1 FROM STACK)
but its giving the results from 1 to 11
how can i change my code
if any one hava idea please tell me