| aus |
Posted: Feb 13, 2008 09:57:31 AM |
Total Post: 10
Joined: Dec, 2007
|
hai friends i want to get a last row`s values from table?how can i achieve that?especially i need to get recently updated values from the last row of a table,because i have to maintain that all the old values also... here i need to take exact one values from last row`s cell which i want to get...is it possible or not?
|
|
|
Murtuja |
| Posted: Feb 13, 2008 11:19:36 PM | |
|
Total Post: 857
Joined: Jan, 2006
|
You must have any column where you can give "ORDER BY" .Otherwise you can't get last row inserted because database doesn't maintain any order for insert.
select * from (select * from table order by col desc ) where rownum <2
|
|
|
|
|
imran |
| Posted: Feb 14, 2008 06:24:50 AM | |
|
Total Post: 3
Joined: Feb, 2008
|
Hi,
You can use this query to fetch last row of the database.
Select * from emp where rowid=(select max(rowid) from emp);
|
|
|
|
|
Garlapati |
| Posted: Feb 19, 2008 05:28:45 AM | |
|
Total Post: 30
Joined: Apr, 2007
|
select * from tmp_raj
where rowid in(select max(rowid) from tmp_raj)
|
|
|
|
|
newuser |
| Posted: Feb 21, 2008 06:18:37 AM | |
|
Total Post: 10
Joined: Feb, 2008
|
hi,
hope this will solve
SELECT * FROM EMP WHERE ROWNUM < 2
ORDER by EMPno desc
Thanks,
Nagaraj
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |