Php 条令查询生成器中的嵌套查询
如何使用条令查询生成器构建嵌套查询 我的mysql查询如下所示:Php 条令查询生成器中的嵌套查询,php,mysql,symfony,doctrine-orm,doctrine,Php,Mysql,Symfony,Doctrine Orm,Doctrine,如何使用条令查询生成器构建嵌套查询 我的mysql查询如下所示: SELECT subquery1.* FROM (SELECT * FROM product WHERE for_her = true && age_teenagers = true && special = true) subquery1 WHERE subquery1.song_rock =true || subquery1.describe_beauty = true; 如何将其转
SELECT subquery1.*
FROM
(SELECT * FROM product
WHERE for_her = true && age_teenagers = true && special = true) subquery1
WHERE subquery1.song_rock =true || subquery1.describe_beauty = true;
如何将其转换为产品实体存储库中的条令查询?在这种情况下,查询可能很容易重新格式化为通常的非嵌套查询。 就我看来是
SELECT * FROM product
WHERE for_her = true AND age_teenagers = true AND special = true
and (song_rock =true OR describe_beauty = true)
因此
Select P from Product P
Where P.forHer=true AND P.ageTeenages=true AND P.specials=true and (P.songRock=true OR P.describeBeauty=true)
在这种情况下,可以很容易地将查询重新格式化为通常的非嵌套查询。 就我看来是
SELECT * FROM product
WHERE for_her = true AND age_teenagers = true AND special = true
and (song_rock =true OR describe_beauty = true)
因此
Select P from Product P
Where P.forHer=true AND P.ageTeenages=true AND P.specials=true and (P.songRock=true OR P.describeBeauty=true)
根据所有记录,那不是真的!检查SO q/a:根据所有记录,这不是真的!检查SO q/a: