如何将其转换为Doctrine QueryBuilder?

时间:2013-02-11 08:35:06

标签: sql doctrine doctrine-orm

如何将其转换为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

1 个答案:

答案 0 :(得分:1)

DQL不支持SELECT子句中的子查询,也不支持UNION子句。请检查DQL's EBNF以查看支持的功能。如果您的查询需要这种程度的复杂性,请考虑使用Native SQL