小编典典

SQL Server子查询语法

sql

当我运行查询时:

select count(*) from 
(select idCover from x90..dimCover group by idCover having count(*) > 1)

我得到错误:

Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near ')'

如何正确制定此查询?

我在使用SQL Server 2000


阅读 196

收藏
2021-03-23

共1个答案

小编典典

在最后一个括号后添加一个别名。

select count(*) from 
(select idCover from x90..dimCover group by idCover having count(*) > 1) a
2021-03-23