0
這個查詢工作是MySQL的SQL Server 2008中不使用LIMIT關鍵字
select
a.id,
a.name,
a.vehicle,
a.amt,
a.date
(select id
from tbl1
where date < a.date and vehicle = a.vehicle
LIMIT 0,1) as prv
FROM
root_tbl a
WHERE
amt <> 0
我需要在SQL Server中此查詢。你能幫我嗎?
'LIMIT'是一個非ANSI標準兼容的自定義擴展,在MySQL中使用 - 它不存在於SQL Server中。你需要使用'SELECT TOP(n).....' – 2014-11-25 05:53:34