【问题标题】:how i can use union and union all in Doctrine1.2我如何在 Doctrine1.2 中使用 union 和 union all
【发布时间】:2013-05-06 12:56:02
【问题描述】:

SELECT avg(mw) as av FROM Meter_reading WHERE hierarchy_id in(1,2) 和 union all SELECT avg(elec) as av FROM Meter_reading WHERE hierarchy_id in(1,2)(示例)

【问题讨论】:

    标签: doctrine-1.2


    【解决方案1】:

    Doctrine 1.2 不支持联合。
    唯一的机会是通过

    执行原始sql
    $statement = $conn->getDbh()->prepare('SELECT ... ');
    $statement->execute($params);
    $result = $statement->fetchAll();
    

    基本上像 php PDO 一样工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-08
      • 1970-01-01
      • 2021-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多