GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 136 of 171    Print  
How do you view the last record added to a table?

  
Total Answers and Comments: 3 Last Update: September 23, 2007     Asked by: t_ahwaz 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: glakshkar
 

select * from test where rowid = ( select max(rowid) from test);

test is table name. Replace test with appropriate table name.



Above answer was rated as good by the following members:
M.REHMAN
September 06, 2007 23:54:48   #1  
glakshkar Member Since: September 2007   Contribution: 5    

RE: How do you view the last record added to a table?

select * from test where rowid ( select max(rowid) from test);

test is table name. Replace test with appropriate table name.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 18, 2007 03:51:29   #2  
smitakaushik Member Since: September 2007   Contribution: 2    

RE: How do you view the last record added to a table?

Hi!
I think its best option to view last record added to a table.
Select * from TableName Order By IdentityFieldName Desc


 
Is this answer useful? Yes | No
September 23, 2007 07:42:56   #3  
Enrique        

RE: How do you view the last record added to a table?
/*
* How do you view the last record added to a table?
*/
Select Top 1 * from Emp Order By EmpID Desc

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape