i think you can not add count()
with where
. now see why ....
where
is not same as having
, having
means you are working or dealing with group and same work of count , it is also dealing with the whole group ,
now how count it is working as whole group
create a table and enter some id's and then use:
select count(*) from table_name
you will find the total values means it is indicating some group ! so where
does added with count()
;