cursor fetching [message #340318] |
Tue, 12 August 2008 05:32  |
krishnapooranitt
Messages: 3 Registered: August 2008 Location: chennai
|
Junior Member |
|
|
Hi
Cursor fetching problem in 10g
When the cursor is fetching the records from table, it have to select the first record among duplicates and then have to reject the remaining records.
For Ex:
Name Class Marks
a EEE 97
a EEE 98
a EEE 99
Eliminating the duplicates based on name and class.
So my cursor should fetch the first record
a EEE 97 and the remaing records should get reject.
But when iam executing the procedure first time it fetching the first record and rejecting the second and third records.
But in the subsequent executions it is fetching the records randomly.
Wats the problem in this.
Can anyone please help on this.
Regards
Suganthi
|
|
|
|
Re: cursor fetching [message #340323 is a reply to message #340318] |
Tue, 12 August 2008 05:43  |
 |
Littlefoot
Messages: 21825 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Or, if possible, a simple MIN function, such asSELECT name, class, MIN(marks)
FROM this_table
GROUP BY name, class
|
|
|