SQL Incorrect Syntax - SELECT incorrect syntax [closed]

A

Atreyix

Guest
Really new to SQL, but I am trying to create a view that will display the top 10 sales from a existing table.

What I have so far:

CREATE VIEW Lastname_vTop10Sales
SELECT TOP 10
UnitPrice
FROM
SalesLT.SalesOrderDetail
ORDER BY
UnitPrice DESC;


The error I am getting:

Msg 156, Level 15, State 1, Procedure Lastname_vTop10Sales, Line 2 [Batch Start Line 0]
Incorrect syntax near the keyword 'SELECT'.
What exactly am I doing wrong here?

Some screenshots of the database/table:

Database overview

SalesOrderDetail, what I'm trying to pull from

Continue reading...
 
Top