Get MAX value from a TOP number of records

Viewed 168

I have the following MS SQL Query

select top 10 RegisterTime
from  orderNotifications
order by RegisterTime asc

How can I get the max RegisterTime of that query ?

I have tried this

select max(RegisterTime) in (
    select top 10 RegisterTime
    from  orderNotifications
    order by RegisterTime asc
)

But I am getting

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

Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword 'order'.

1 Answers
Related