andrevanzyl, A relational database has no concept of First or Last row. You have to supply something so that can be determined. This 'something' could be a unique sequential number, a timestamp, some sortable column, etc..
Once you have this 'something', you can use the MIN and MAX functions or use and ORDER BY and FETCH FIRST 1 ROW ONLY (using two queries in Ascending and Descending order). The Row_Number function could also be used (and there may be other options).
Without more information, I can't be any more specific.