我在使用 SQL CE 时遇到了很多问题,这只是其中之一。
我正在尝试从另一个表中获取最新日期的一行,但此查询出现错误:
选择 Projects.Client、Projects.Name、Projects.PO_No、Projects.PO_Date、Projects.Facility、
(SELECT top (1) Remarks FROM Status WHERE Proj_ID = @1 ORDER BY Date DESC ),
...这里还有几列...
FROM Projects LEFT OUTER JOIN Collections AS b ON Projects.Proj_ID = b.Proj_ID LEFT OUTER JOIN Imp AS c ON Projects.Proj_ID = c.Proj_ID LEFT OUTER JOIN Acceptance AS d ON Projects.Proj_ID = d.Proj_ID LEFT OUTER JOIN Billing AS e ON Projects.Proj_ID = e.Proj_ID WHERE (Projects.Proj_ID = @1)
有任何想法吗?
编辑:这是错误
-------------------------- Microsoft Visual C# 2010 Express ------------------ --------- SQL 执行错误。
执行的 SQL 语句:SELECT Projects.Client、Projects.Name、Projects.PO_No、Projects.PO_Date、Projects.Facility、
(SELECT top (1) 备注
从状态
按日期顺序排序),
...
错误来源:SQL Server Compact ADO.NET 数据提供程序错误消息:解析查询时出错。[令牌行号= 4,令牌行偏移量= 2,错误令牌= SELECT]