我有以下查询
select
sub.W
from
(select
W, count(W) as N
from L
group by W) sub
where
sub.N >= max(sub.N)
我得到了这个错误:
错误代码1111,SQL状态HY000:组功能的使用无效
第1行,第1列
怎么了?
您是否尝试过:
select sub.W
from
(
select W, count(W) as N
from L
group by W
) sub
where n >= (select max(N)
from
(
select count(W) as N
from L
group by W
) x)
请参阅带有演示的SQL小提琴
尝试:
select sub.W
from
(
select W, count(W) as N
from L
group by W
) sub
where sub.N >= (select max(N)
from (
select W, count(W) as N
from L
group by W
) sub2)