I have some very basic SQL here:
SELECT TOP 1 *
FROM (SELECT TOP 8 *
FROM [BP_BasicPolicy ]
)
For some reason it does not compile and I get the error:
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near ')'.
What is the correct syntax? I don't understand why I'm getting this error as I thought it was perfectly legitimate SQL Server syntax
TOPwithoutORDER BYis a) meaningless, and b) not allowed in a subquery. What are you attempting to do?SELECT top 1 * FROM [BP_BasicPolicy] ORDER BY somethingwork?