我有这样的查询:
SELECT * FROM dbo.ScheduledatesFF AS a INNER JOIN
dbo.tblCustomers AS c ON a.Job_No = c.Job_No INNER JOIN
dbo.scheduledatesSS AS z ON a.Job_No = z.Job_No LEFT OUTER JOIN
dbo.maxscheddate AS m ON a.Job_No = m.Job_No LIMIT 10;
但是我收到错误,说'LIMIT'附近的语法不正确。我做错了什么?
答案 0 :(得分:3)
使用
SELECT TOP 10 * FROM dbo.ScheduledatesFF AS a INNER JOIN
dbo.tblCustomers AS c ON a.Job_No = c.Job_No INNER JOIN
dbo.scheduledatesSS AS z ON a.Job_No = z.Job_No LEFT OUTER JOIN
dbo.maxscheddate AS m ON a.Job_No = m.Job_No
SQL Server使用TOP N语法而不是LIMIT N