che errore ti da?
hai provato a dare un alias?

SELECT COUNT(id) AS pippo ...