gpt4 book ai didi

SQL Server 子查询语法

转载 作者:行者123 更新时间:2023-12-01 19:57:50 24 4
gpt4 key购买 nike

当我运行查询时:

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

最佳答案

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

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

关于SQL Server 子查询语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1102673/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com