【发布时间】:2010-10-04 13:44:47
【问题描述】:
我有以下疑问:
WITH cte AS (
SELECT
windowId, frameIndx, elemIndx, comment,
ROW_NUMBER() OVER (PARTITION BY frameIndx ORDER BY elemIndx DESC)
AS
rn
FROM
dbo.translations
WHERE
windowId = 1 AND frameIndx IN (
SELECT
indx
FROM
dbo.translations_window
WHERE program_id = 1 AND active = 1
)
)
SELECT
windowId, frameIndx, elemIndx, comment
FROM
cte
WHERE
rn = 1
在使用管理工作室的 SQL Server 2008 R2 Developer(无论如何)、SQL Server 2005 Express 和 SQL Server 2008 R2 Express 中运行时,查询执行没有问题(这适用于最后两个)。但是,一旦我尝试使用 Delphi 的 ADODB 执行此查询,我就会收到一条错误消息。
Incorrect syntax near the keyword WITH
在 SQL 的快速版本中是否不允许此类查询?查询中有什么问题?客户端使用 SQL express,所以我需要找到一个在 express 版本中运行的解决方案。
【问题讨论】:
-
听起来 ADODB 不支持这个...
标签: sql-server delphi tsql sql-server-express adodb