SQL Server First, Last Aggregate Functions
Writing by shivdev on Tuesday, 20 of May , 2008 at 4:01 pm
Are you getting a SQL Server error saying that FIRST or LAST are not recognized or unsupported?
Error:’FIRST’ is not a recognized built-in function name. Number:195 Severity:15 State:10
Thats because they’re not.
SELECT LotFk, FIRST(RedemptionPeriodDate) as RedemptionPeriodDate -- ERROR FROM InvRegister GROUP BY LotFk
Workaround is to use MIN or MAX
SELECT LotFk, MIN(RedemptionPeriodDate) as RedemptionPeriodDate -- VALID FROM InvRegister GROUP BY LotFk
Leave a comment
Category: SQL DB
- Add this post to
- Del.icio.us -
- Digg -
- -
- Tweet -
-
-
No comments yet.
You must be logged in to post a comment.