gpt4 book ai didi

sql - HAVING 的参数必须是 bool 类型,而不是整数类型

转载 作者:行者123 更新时间:2023-11-29 14:19:30 24 4
gpt4 key购买 nike

我有一个 table 类(class)以及超过两行的 placecost 列。

我希望我的查询显示成本最高的类(class)。我尝试了以下查询

select splace 
from studies
group by splace
having max(ccost);

并得到错误,因为 HAVING 的参数必须是 bool 类型,而不是整数类型

我犯了什么错误?什么是正确的查询?

最佳答案

select  place
from studies
where cost =
(
select max(cost)
from studies
)

关于sql - HAVING 的参数必须是 bool 类型,而不是整数类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34512450/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com