select max(postal_code) from address
where max(postal_code)
IN (select Min(postal_code) from address
group by district
having min(postal_code) <> "" and district <> "" );
谁能告诉我为什么会出现这个错误?
最佳答案
错误在下一行。除了 HAVING
子句
WHERE
子句中使用组函数
where max(postal_code)
您可以尝试像下面这样修改您的查询
select max_postalcode
from
(
select max(postal_code) as max_postalcode,
Min(postal_code) as min_postal_code
from address
where district is not null
group by district
having min(postal_code) is not null
) xxx
where max_postalcode = min_postal_code;
关于mysql - 错误代码 : 1111. 群组功能使用无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32268863/