Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Efficient SELECT statement needed
Folks
I need a efficient select statement as I need to process up 60,000 records from a single table.
Let say we have table T, that contains the following columns and data
What I need to do is SELECT everything from table T, but only SELECT one column for records that have consecutive values of A and equal values of B, C and D, and show the start and finish values of A as well as the values of B, C and D.
The above table would return the following result.
We already have a solution to this problem using PL/SQL but it is much to slow when dealing with a large number of records. This solution selects all records from table T into a cursor. Each record was then processed one by one. When a 'run' is detected the finish A value is stored in an extra column E of the first record in the run, with all further records being deleted.
If anyone can provide a way to approach solving this problem it would be much appreciated.
Thank you
Colin Woods. Received on Fri May 22 1998 - 04:19:40 CDT