错误,只在一个数据库中运行一个查询

时间:2013-04-22 08:53:34

标签: sql sql-server

我有一个查询在除一个以外的所有数据库中工作。并且它没有运行的数据库给出了以下错误。

[Error] Script lines: 1-7 --------------------------
 Incorrect syntax near '('. 

 More exceptions ... Incorrect syntax near ','.

以下是查询

SELECT onecolumn, secondcolumn FROM one_table WHERE {someConditions}
AND someColumn NOT IN (select value from otherDB.dbo.functionName((select someList
from otherDB..otherDBTable where {someConditions}),','))

知道为什么会这样......真的很令人沮丧。

由于

1 个答案:

答案 0 :(得分:2)

SELECT部分​​中有一个逗号,它应该是这样的:

SELECT onecolumn, secondcolumn FROM one_table WHERE {someConditions}
AND someColumn NOT IN (select value from otherDB..dbo.funcitonName((select someList
from otherDB..otherDBTable where {someConditions}),','))
相关问题