MySQL count statements error - operand should contain 1 column(s)
Posted
by jason
on Stack Overflow
See other posts from Stack Overflow
or by jason
Published on 2010-04-05T05:23:54Z
Indexed on
2010/04/05
5:33 UTC
Read the original article
Hit count: 180
I am trying to do multiple counts everyone was working accept the first sub select (list1) I get an error that reads "Operand should contain 1 column(s)" i'm guessing it has something to do with the AND, but i'm not sure how I would fix this one.
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 list0
Where list0.ustatus = 1
© Stack Overflow or respective owner