我的查询如下,其中包含一个子查询:
select count(distinct dNum)
from myDB.dbo.AQ
where A_ID in
(SELECT DISTINCT TOP (0.1) PERCENT A_ID,
COUNT(DISTINCT dNum) AS ud
FROM myDB.dbo.AQ
WHERE M > 1 and B = 0
GROUP BY A_ID ORDER BY ud DESC)
我收到的错误是......
Only one expression can be specified in the select list when the subquery is not
introduced with EXISTS.`
当我单独运行子查询时,它返回就好了,所以我假设主查询有问题?