bottom 100

  • if top 100 returns the first 100 records in a table, how do I get the last 100 records in a table? Can use the key but is there a converse to top 100?

  • use TOP 100 and ORDER BY DESC?

  • 'Top 100' by itself doesn't return the 'first', it returns the 'first found by the query'.

    If 'first' is implied by some kind of order, you must use ORDER BY on that column.

    --=== 'First'

    select top 10 error from master..sysmessages order by error asc

    --=== 'Last'

    select top 10 error from master..sysmessages order by error desc

    /Kenneth

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply