Home » SQL & PL/SQL » SQL & PL/SQL » how to find last or latest inserted row.?
how to find last or latest inserted row.? [message #582700] Mon, 22 April 2013 00:47 Go to next message
srikanth_d5
Messages: 39
Registered: June 2012
Location: hyderabad
Member

Hi all,

i have a table in that every month i insert rows and my table doesn't have primary key,index and date filed.


for example:-table is like this

name salary Id
john 5000 101
brat 4500 102
smith 4600 103
john 5500 101
brat 4600 102
smith 4800 103

i think one cannot tell in above table whether "john" salary is 5000 or
5500(last insert row is 5000 then john salary is 5000)

when it comes to retrieve i have to pick the latest(last) insert row of particular Name.
Is there any auto generated row_numbers in Oracle.can anyone please guide me

Thanks and Regards
Re: how to find last or latest inserted row.? [message #582705 is a reply to message #582700] Mon, 22 April 2013 01:53 Go to previous message
John Watson
Messages: 4672
Registered: January 2010
Location: Global Village
Senior Member
This was discussed recently, here
http://www.orafaq.com/forum/mv/msg/187138/582068/148813/#msg_582068
Go through the topic, and see if flashback query or rowdependencies would help. They both have problems that may make them unusable, but they are all you have.
You really need to fix the data design.

Previous Topic: Simple updation failed ? Reason ?
Next Topic: Deducing rows
Goto Forum:
  


Current Time: Mon Oct 20 13:32:34 CDT 2014

Total time taken to generate the page: 0.12899 seconds