View previous topic :: View next topic
|
Author |
Message |
Help-Me-Out
New User
Joined: 09 Dec 2006 Posts: 56 Location: Pune
|
|
|
|
Hi,
I have the requirement to fetch the record for last updation.
I am not able to fetch the record. I have tried Max function. The table contains the duplicate rows. Can you anyone tell me how to fetch the records without writing a cursor?
Time_upd is field of the table.
Thanks,
Sandy... |
|
Back to top |
|
|
priyamnavada
New User
Joined: 24 Dec 2005 Posts: 52 Location: hyderabad
|
|
|
|
SELECT MAX(TIME_UPD)
FROM TABLE
FETCH FIRST 1 ROW ONLY; |
|
Back to top |
|
|
priyamnavada
New User
Joined: 24 Dec 2005 Posts: 52 Location: hyderabad
|
|
|
|
sorry... i was in rush. could not able to read your question correctly. what you want? you want the records lastly updated right? |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
If you have a timestamp in the table you can always use that timestamp to get the latest record updated. |
|
Back to top |
|
|
Help-Me-Out
New User
Joined: 09 Dec 2006 Posts: 56 Location: Pune
|
|
|
|
Thanks.
But yet my problem is not resolved.
MAX(TIME_UPD) will give me the unique row, but it creates the performance issue.
I need the record which is recently updated. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Help-Me-Out wrote: |
Thanks.
But yet my problem is not resolved.
MAX(TIME_UPD) will give me the unique row, but it creates the performance issue.
I need the record which is recently updated. |
Is time_upd an indexed column, if not that would be the cause of your performance issue. |
|
Back to top |
|
|
|