LinkedServer Openquery is throwing this error : ORA-00923: FROM keyword not found where expected

LinkedServer Openquery is throwing this error : ORA-00923: FROM keyword not found where expected

我 运行 在 SQL Server 2012 中针对链接服务器进行查询,但出现以下错误。 我是在使用不正确的 keyword/function 还是缺少任何句法。 当我 运行 没有 openquery

时,查询 运行 很好
ORA-00923: FROM keyword not found where expected

查询如下:

select * from openquery(LinkedServerName,
'select t.TRANSACTION,t.PARTNER,t.DATE

from

(select st.TRANSACTION,st.PARTNER,st.DATE
,RowNum = ROW_NUMBER() over(partition by st.TRANSACTION order by st.DATE desc)
from tbltransactions st) t where t.RowNum = 1')

请尝试

select * from openquery(LinkedServerName,
'select t.TRANSACTION,t.PARTNER,t.DATE

from

(select st.TRANSACTION,st.PARTNER,st.DATE
,ROW_NUMBER() over(partition by st.TRANSACTION order by st.DATE desc) as RowNum
from tbltransactions st) t where t.RowNum = 1')