我正在尝试ClientID
使用 group by 和 having 子句从以下子查询中提取,但出现以下错误:
Msg 116, Level 16, State 1, Line 1
当不使用 EXISTS 引入子查询时,选择列表中只能指定一个表达式。
询问:
select
ClientID
from
SurveyResponses
where
ClientID in (select ClientID, count (surveyresponseid)
from SurveyResponses
where SurveyID in (1988,1989,2750,3206,15561)
group by
ClientID
having count (SurveyResponseID) > 1) and SurveyID = 1989