Bug #58802 Count does not accept an Alias
Submitted: 7 Dec 2010 21:25 Modified: 8 Dec 2010 0:06
Reporter: Carlos Gomes Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version: OS:Any
Assigned to: CPU Architecture:Any

[7 Dec 2010 21:25] Carlos Gomes
Description:
Count does not accept a COUNT.  I have tried all the following:

select count(`pump`.*) from mytable as pump where `pump`.`type`='1';
select count(pump.*) from mytable as pump where `pump`.`type`='1';
select count(`pump`.*) from mytable as pump where pump.`type`='1';

How do I make this work?

How to repeat:

select count(`pump`.*) from mytable as pump where `pump`.`type`='1';
select count(pump.*) from mytable as pump where `pump`.`type`='1';
select count(`pump`.*) from mytable as pump where pump.`type`='1';
[7 Dec 2010 21:39] MySQL Verification Team
Duplicate of bug: http://bugs.mysql.com/bug.php?id=28452.
[8 Dec 2010 0:07] Carlos Gomes
Your response is useless.  

Here is something that my help:

select count(alias.*) does not not work, but select count(alias.field) does.

good: select count(pump.id) from table mytable as pump good.
bad: select count(pump.*) does not work at all.