symfony嵌套查询

时间:2019-01-27 21:10:51

标签: sql symfony doctrine

如何使用symfony和doctrine queryBuilder执行嵌套查询? 例如:

select data.name from
(
  select case when name = 'Alfred' then 'Thomas' else name end as name
  from employee
) as data;

谢谢

1 个答案:

答案 0 :(得分:0)

我使用本地sql解析:

    $stmt = $this->doctrine->getConnection()->prepare('your_query');
    $stmt->execute();
    $res = $stmt->fetchAll();