gpt4 book ai didi

mysql - 如何将以下 3 个查询压缩为一个?

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

如何将以下 3 个查询压缩为一个?

select count(*) as fs1 from feedback WHERE feedbackStatus = 1
select count(*) as fs2 from feedback WHERE feedbackStatus = 2
select count(*) as fs3 from feedback WHERE feedbackStatus = 3

最佳答案

select count(*) as count_status, feedbackStatus
from feedback
where feedbackStatus in (1, 2, 3)
group by feedbackStatus

关于mysql - 如何将以下 3 个查询压缩为一个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54815846/

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