To elaborate, LAST and FIRST are not relational concepts. By definition, SQL record sets are unordered. SQL Server does not guarantee order of result sets returned by queries unless the Order By clause is used. Thus the only way to get FIRST or LAST rows is to use an order indicator such as an identity column or datetime.
Tables are ordered physically by a clustered index and my experience has been that simple selects from a single table without an order by clause will return results in the sequence of the clustered index, if one exists on the table. However, Microsoft makes no guaranteee that this will always be the case. Terry L. Broadbent - DBA
Computing Links:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.