Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 first or last record in group

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2006-05-16 : 16:24:46
In Access, if I group rocords, there are "first" or "last" in drop down list to select. In SQL views, if I add group, there is no "first" or "last" from drop down list. How to make them available?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-05-16 : 16:29:31
SELECT TOP 1 SomeColumn
FROM YourTable
ORDER BY SomeColumn ASC

SELECT TOP 1 SomeColumn
FROM YourTable
ORDER BY SomeColumn DESC

Tara Kizer
aka tduggan
Go to Top of Page
   

- Advertisement -