Results 1 to 3 of 3
  1. #1
    Join Date
    May 2010
    Hyderabad, India

    Unanswered: How to fetch the last row from a table

    I need to fetch the last row from a table.

    Is there any inbuilt function to fetch the last row in from a table in sybase??

    any one could you please help me.

    Thanks in advance

  2. #2
    Join Date
    May 2005
    South Africa
    Provided Answers: 1
    There is no such thing as first row or last row.
    There is no specific order. If you want data in a specific order you must use an order by clause.
    What do you consider as first or last? Maybe cosider the min() or max() functions.

  3. #3
    Join Date
    Aug 2010
    Last row:

    select *
    from mytable
    where id = (select max(id) from mytable)

Posting Permissions

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