Use count(d.ertek) or count(d.id) instead of count(d). This can be happen when you have composite primary key at your entity.
Use count(d.ertek) or count(d.id) instead of count(d). This can be happen when you have composite primary key at your entity.