Reputation: 700
How convert it to Doctrine QueryBuilder?
SELECT A.*
,(SELECT COUNT(created_on)
FROM event WHERE DATE=created_on) created
,(SELECT COUNT(updated_on)
FROM event WHERE DATE=updated_on) updated
FROM (
SELECT created_on DATE FROM event
UNION SELECT updated_on FROM event ) A
Upvotes: 0
Views: 716
Reputation: 25431
DQL does not support subqueries in the SELECT
clause, nor the UNION
clause. Please check DQL's EBNF to see what the supported features are. Consider using Native SQL if your query needs this degree of complexity.
Upvotes: 1