Home » SQL & PL/SQL » SQL & PL/SQL » calculate the total of 29 rows and compare it with 30th row...untill 60000 rows
calculate the total of 29 rows and compare it with 30th row...untill 60000 rows [message #7385] Tue, 10 June 2003 16:48 Go to next message
chandra
Messages: 31
Registered: October 2000
Member
Hi,

I have 60000 rows and have to calculate the data for every 29 rows and compare it with the 30th row..untill all the 60000 rows are calculated.

help is highly appreciated.

chandra
Re: calculate the total of 29 rows and compare it with 30th row...untill 60000 rows [message #7386 is a reply to message #7385] Tue, 10 June 2003 23:50 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
You do know that Oracle doesn't store rows in any particular order, don't you? There's no way in telling what will be the 30th row. And in general it is bad practice to assume the records are stored in the insert order. There are just too many factors involved. Isn't there any field you can sort the data by?

MHE
Re: calculate the total of 29 rows and compare it with 30th row...untill 60000 rows [message #7392 is a reply to message #7385] Wed, 11 June 2003 03:59 Go to previous message
Kavitha
Messages: 40
Registered: December 1999
Member
Hi,

If you have a condition by which you can group 30 rows together and assuming you want to store some calculated values of 29 rows on the 30th row of the same group, you can use the Analytical commands, which has the window /range window option.

For more information, please look up Analytical Commands in Oracle 9i.

Cheers
Kavitha
Previous Topic: Table / column Comments
Next Topic: Getting highest sal in the dept
Goto Forum:
  


Current Time: Fri Apr 19 15:05:23 CDT 2024