我有以下查询
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
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)
尝试:
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)