gpt4 book ai didi

sql - MySQL 计数语句错误 - 操作数应包含 1 列

转载 作者:太空宇宙 更新时间:2023-11-03 11:19:14 24 4
gpt4 key购买 nike

我正在尝试进行多次计数,每个人都在接受第一个子选择 (list1) 我收到一条错误消息“Operand should contain 1 column(s)”我猜它有与 AND 有关,但我不确定如何解决这个问题。

  Select Count(list0.ustatus) AS finished_count
, (Select list1.ustatus, Count(*)
From listofupdates list1
Where list1.ustarted != '0000-00-00 00:00:00'
AND list1.ustatus != 1
) AS start_count
, (Select Count(list2.udifficulty)
From listofupdates list2
Where list2.udifficulty = 2
) AS recheck_count
, (Select Count(list3.udifficulty)
From listofupdates list3
Where list3.udifficulty = 4
) AS question_count
From listofupdates as list0
Where list0.ustatus = 1

最佳答案

我完全同意@Chad Birch 的观点

以下查询应该有效。

 Select Count(list0.ustatus) AS finished_count
, (Select Count(*)
From listofupdates list1
Where list1.ustarted != '0000-00-00 00:00:00'
AND list1.ustatus != 1
) AS start_count
, (Select Count(list2.udifficulty)
From listofupdates list2
Where list2.udifficulty = 2
) AS recheck_count
, (Select Count(list3.udifficulty)
From listofupdates list3
Where list3.udifficulty = 4
) AS question_count
From listofupdates as list0
Where list0.ustatus = 1

关于sql - MySQL 计数语句错误 - 操作数应包含 1 列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2577051/

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