How to select "last but one row" from a table????? [message #18667] |
Sun, 10 February 2002 18:05  |
Sarada
Messages: 27 Registered: April 2001
|
Junior Member |
|
|
Hi All,
Please help me to find last but one row from a table. I need to get this based on an ID value which is a PK in other table.
Something like, Customers, OrderHeaders where they both have a 1:M relationship. I need to find the "last but one row" retrieving the OrderEntryDate for a given customer from the OrderHeader Table.
This is very URGENT!!!!!!!!
Thanks in Advance,
Sarada
|
|
|
Re: How to select [message #18685 is a reply to message #18667] |
Mon, 11 February 2002 02:27  |
Sarada
Messages: 27 Registered: April 2001
|
Junior Member |
|
|
select max(rowid) from table; this will show you the last but one row. If it is in peak hour it may give you some wrong result. If correct answer is needed make that tablespace offline first
|
|
|