<legend id='1uQ7x'><style id='1uQ7x'><dir id='1uQ7x'><q id='1uQ7x'></q></dir></style></legend>
    <tfoot id='1uQ7x'></tfoot>
  • <i id='1uQ7x'><tr id='1uQ7x'><dt id='1uQ7x'><q id='1uQ7x'><span id='1uQ7x'><b id='1uQ7x'><form id='1uQ7x'><ins id='1uQ7x'></ins><ul id='1uQ7x'></ul><sub id='1uQ7x'></sub></form><legend id='1uQ7x'></legend><bdo id='1uQ7x'><pre id='1uQ7x'><center id='1uQ7x'></center></pre></bdo></b><th id='1uQ7x'></th></span></q></dt></tr></i><div id='1uQ7x'><tfoot id='1uQ7x'></tfoot><dl id='1uQ7x'><fieldset id='1uQ7x'></fieldset></dl></div>
    1. <small id='1uQ7x'></small><noframes id='1uQ7x'>

          <bdo id='1uQ7x'></bdo><ul id='1uQ7x'></ul>

        Doctrine_RawSql 查询中的聚合值

        Aggregate values in Doctrine_RawSql queries(Doctrine_RawSql 查询中的聚合值)

      1. <legend id='Tnfte'><style id='Tnfte'><dir id='Tnfte'><q id='Tnfte'></q></dir></style></legend>
          <tbody id='Tnfte'></tbody>

        <small id='Tnfte'></small><noframes id='Tnfte'>

        <i id='Tnfte'><tr id='Tnfte'><dt id='Tnfte'><q id='Tnfte'><span id='Tnfte'><b id='Tnfte'><form id='Tnfte'><ins id='Tnfte'></ins><ul id='Tnfte'></ul><sub id='Tnfte'></sub></form><legend id='Tnfte'></legend><bdo id='Tnfte'><pre id='Tnfte'><center id='Tnfte'></center></pre></bdo></b><th id='Tnfte'></th></span></q></dt></tr></i><div id='Tnfte'><tfoot id='Tnfte'></tfoot><dl id='Tnfte'><fieldset id='Tnfte'></fieldset></dl></div>

            <bdo id='Tnfte'></bdo><ul id='Tnfte'></ul>

                  <tfoot id='Tnfte'></tfoot>
                  本文介绍了Doctrine_RawSql 查询中的聚合值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否可以在 Doctrine_RawSql 查询中使用聚合值?这是我正在尝试做的事情:

                  Is it possible to use aggregate values in Doctrine_RawSql query? Here's what I'm trying to do:

                  $q = new Doctrine_RawSql();
                  $q->select('{q.*}, AVG(a.value) AS avg');
                  $q->from('-- complex from clause');
                  $q->addComponent('q', 'Question');
                  

                  但是,Doctrine 创建的 SQL 只保留表 question 中的列,并省略聚合值 avg.

                  However, SQL created by Doctrine leaves only columns from table question and omits aggregate value avg.

                  推荐答案

                  我之前从未使用过Doctrine_RawSql,但是我使用这两种方法之一通过Doctrine 完成了原始SQL 查询:

                  I've never used Doctrine_RawSql before, but I have done raw SQL queries through Doctrine using either of these two methods:

                  Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAssoc("YOUR SQL QUERY HERE");
                  

                  $doctrine = Doctrine_Manager::getInstance()->getCurrentConnection()->getDbh();
                  $result = $doctrine->query('YOUR SQL QUERY HERE');
                  

                  这两种方法似乎会使您的原始 SQL 保持不变.

                  It seems like these two methods would leave your original SQL intact.

                  我应该注意,我在 Symfony 1.4 应用程序的上下文中使用 Doctrine 1.2,但是 AFAIK,无论您使用什么其他框架,这都对您有用.

                  I should note that I'm using Doctrine 1.2 within the context of Symfony 1.4 applications, but AFAIK, this would work for you regardless of what other frameworks you may be using.

                  这篇关于Doctrine_RawSql 查询中的聚合值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    <bdo id='s1sQ8'></bdo><ul id='s1sQ8'></ul>
                  • <i id='s1sQ8'><tr id='s1sQ8'><dt id='s1sQ8'><q id='s1sQ8'><span id='s1sQ8'><b id='s1sQ8'><form id='s1sQ8'><ins id='s1sQ8'></ins><ul id='s1sQ8'></ul><sub id='s1sQ8'></sub></form><legend id='s1sQ8'></legend><bdo id='s1sQ8'><pre id='s1sQ8'><center id='s1sQ8'></center></pre></bdo></b><th id='s1sQ8'></th></span></q></dt></tr></i><div id='s1sQ8'><tfoot id='s1sQ8'></tfoot><dl id='s1sQ8'><fieldset id='s1sQ8'></fieldset></dl></div>
                      <tbody id='s1sQ8'></tbody>
                  • <tfoot id='s1sQ8'></tfoot>

                        1. <legend id='s1sQ8'><style id='s1sQ8'><dir id='s1sQ8'><q id='s1sQ8'></q></dir></style></legend>
                        2. <small id='s1sQ8'></small><noframes id='s1sQ8'>