Answer the question
In order to leave comments, you need to log in
Why does select count(*) return zero, while normal select returns a normal selection?
Good afternoon, colleagues.
There was such a problem.
Updated mysql 5.6 (only a minor figure has been updated, now 5.6.27 from the official mysql repository, that is, before that there was another 5.6.* version).
And now the simple select count(*) request has fallen off.
Full listing:
SELECT COUNT(*) as `count` FROM `package` WHERE `active`=1 AND `deleted`=0
The query returns null. SELECT * FROM `package` WHERE `active`=1 AND `deleted`=0
returns a normal selection of 900+ records (total ~ 1000 rows in the table) SELECT COUNT(*) as `count` FROM `package` WHERE `deleted`=0
orSELECT COUNT(*) as `count` FROM `package` WHERE `active`=1
then a normal value (900+) is returned. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question