Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    181

    Unanswered: Create a view on the last 5 rows in a table

    Hi Lo,

    I was wondering if anyone out there knows how to create a view on the last 5 rows of a table.

    The table should be updated every half hour or so but I only want the last 5 rows to be seen in the view.

    Any ideas?
    I'm a DBA that doesn't know that much about PL/SQL.

    Thanking you,
    Breen.

  2. #2
    Join Date
    Apr 2001
    Location
    Netherlands
    Posts
    191
    Umm you could try

    select * from
    (select * from table
    order by date desc)
    where rownum < 5

    Assuming the entry date is in the table.

    Just an idea
    Ruud Schilders
    -----------------
    Oracle DBA
    e-mail : ruud@schilders.it
    URL : www.schilders.it
    Twitter : www.twitter.com/ruudschilders

  3. #3
    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    181
    Thanking you very much Ruud,

    Didn't even know you could do that.

    Breen.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •