Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Retaining first duplicate in my cursor fetch in a SP

530198Aug 26 2006 — edited Aug 29 2006
Hi,

I think this is more of a Sql tuning query rather on Oracle. Only thing is that my DB is Oracle.

I have a cursor defined in my stored proc which returns data as following -

Col1 Col2 Col3 Col4 Col5
----- ------ ------ ------ ------
111111 121212 1A1313 20060825 100
111111 121212 1B1313 20060825 200
111111 121212 1C1313 20060826 200
111111 121212 1D1313 20060826 400
111111 121212 1E1313 20060827 300
111111 121212 1F1313 20060827 600


What I want is to have one record each from the above duplicate entries - as you can see there are two entries for a single date - I want to have only the first entry for any date as my output.

Output I desire will look like:

Col1 Col2 Col3 Col4 Col5
----- ------ ------ ------ ------
111111 121212 1A1313 20060825 100
111111 121212 1C1313 20060826 200
111111 121212 1E1313 20060827 300


I am looking for the best possible way to do this.

Thanks,
Sreeroop
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 26 2006
Added on Aug 26 2006
18 comments
572 views