Fixed SQL statement where clause to use count(*)