Alternatively you can use top 1 in conjuction with order by clause
i.e.
TO get last, use
Select top 1 column1 from yourtable Order by id Desc
To get first, use
Select top 1 column1 from yourtable Order by id
Hope that helps, if it does, mark it as answer/upvote.
Thanks
Milind