First of the column and last of the column

hi there,
sorry if it is a repost, please redirect me if this topic has been discussed. thank you.
my question is how do i get the first entry of the particular column and the last entry of the same column without calculating the number of row?
as for now my way of doing it is
select column1 from table1 where rownum=1
and
select column1 from table1 where rownum=lastrow
but this takes up too much time....
appreciate for recommendations

"select column1 from table1 where rownum=lastrow"
I think this SQL statement will return nothing, the reason can be found here.
http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
Get the last entry of the particular column:
select * from(
select column1 from table1 order by rowid desc
) where rownum = 1
Get the first entry of the particular column:
select * from(
select column1 from table1 order by rowid order by rowid
) where rownum = 1

Similar Messages

Maybe you are looking for

  • Windows Small Business Server 2008 c000021a 0x00000000 wusa

    Good day (well hopefully it improves...), I initially got a BSOD 0xc00000f which chkdsk sorted then I ran into 0xc000000f which I got around by restoring backup hives.  0xc000000d was in there somewhere as well which, if I remember this whole process

  • File updation in PDF File format:

    Hiii.....                     If i do any type of updation in the pdf file, what are the effects of updation in its file format...????? And which type of updates can we do in pdf file. I know little bit about the links,comments,notes,bookmarks etc..

  • How to clear interco vendor/customer which auto created during interco pstg

    Hi all, During intercompany posting, system auto created vendor/customer line items. When and how these created items to be clear out? TQ

  • Bluetooth and Libretto U100

    Has anyone else found the bluetooth functionality predominantly restrictive. There seems no way of exploring another device such as a mobile phone, PDA or another computer. I have the TOSHIBA LIBRETTO 108 with XP home and 30Gb HDD! Often I make notes

  • OS5 Security: Log out required to refresh?

    Question: Using OS5.0 SP2, when I make a change to a user's profile, must that user log out and back in for that update to become effective? If this is the case, what happens if the update is being applied is more restrictive...and, the user never lo