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 2005 Forums
 Transact-SQL (2005)
 max() over (partition by ) gives error

Author  Topic 

NettlesD
Starting Member

2 Posts

Posted - 2008-03-31 : 15:40:37
I keep getting this error:

Msg 156, Level 15, State 1, Line 12
Incorrect syntax near the keyword 'over'.


What am I missing? The max() over statement looks just like the statement in the documentation.

select RegistrationId,
OrderId,
Sequence,
Title,
InformalFirstName,
FirstName,
MiddleName,
Lastname,
EntryDate,
max(Sequence) over(partition by RegistrationId) as 'maxsequence'
from registration
where OrderId = '68379449583' and
Year = '2008' and
Active = 'Yes'

NettlesD
Starting Member

2 Posts

Posted - 2008-03-31 : 16:03:33
Never mind. I'm new to SQL Server (coming from the Oracle World) and I did a google on SQL Server 8.0.760 and that is SQL Server 2000 and not SQL Server 2005. No wonder I couldn't get the SQL statement to work.
Go to Top of Page
   

- Advertisement -