• <tfoot id='FV4oo'></tfoot>

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

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

      1. <i id='FV4oo'><tr id='FV4oo'><dt id='FV4oo'><q id='FV4oo'><span id='FV4oo'><b id='FV4oo'><form id='FV4oo'><ins id='FV4oo'></ins><ul id='FV4oo'></ul><sub id='FV4oo'></sub></form><legend id='FV4oo'></legend><bdo id='FV4oo'><pre id='FV4oo'><center id='FV4oo'></center></pre></bdo></b><th id='FV4oo'></th></span></q></dt></tr></i><div id='FV4oo'><tfoot id='FV4oo'></tfoot><dl id='FV4oo'><fieldset id='FV4oo'></fieldset></dl></div>
      2. <legend id='FV4oo'><style id='FV4oo'><dir id='FV4oo'><q id='FV4oo'></q></dir></style></legend>
      3. 为什么列别名在学说中不起作用?

        Why does column alias not work in doctrine?(为什么列别名在学说中不起作用?)
        <legend id='BRyqf'><style id='BRyqf'><dir id='BRyqf'><q id='BRyqf'></q></dir></style></legend>
            <tbody id='BRyqf'></tbody>

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

              <tfoot id='BRyqf'></tfoot>

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

                  <bdo id='BRyqf'></bdo><ul id='BRyqf'></ul>
                  本文介绍了为什么列别名在学说中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的脚本是这样的:

                  $query = Doctrine_Query::create ()
                    ->select('count(p.product_id) as num_a')              
                    ->from ( 'ProductComments p' )
                    ->groupBy('p.product_id')
                    ->having('num_a =2 ');
                  

                  而生成的sql是:

                  SELECT COUNT(i.product_id) AS i__0 FROM productcomments i GROUP BY i.product_id HAVING num_a=2
                  

                  因此我在执行 sql 时遇到错误.

                  Thus I get an error when execute the sql.

                  我有两个问题:

                  1. 为什么表的别名是'i'而不是'p'?

                  为什么have子句中的'num_a'没有替换成'i__0',如何解决?

                  why is the 'num_a' in having clause not replaced with 'i__0',how to fixed it?

                  感谢您的建议...

                  推荐答案

                  1:为什么表'i'的别名是而不是p"?

                  1: why is the alias of the table 'i' instead of 'p'?

                  2: 为什么是 'num_a'in have 子句不替换为'i__0',如何解决?

                  2: why is the 'num_a' in having clause not replaced with 'i__0',how to fixed it?

                  这两个问题都得到了简单的回答:Doctrine 使用它自己的别名进行查询.您无需知道这些别名,因为它们不会影响您,您也不需要使用它.

                  Both questions are simply answered: Doctrine uses it's own aliases for the query. You do no need to know these aliases since they will not affect you nor will you need to work with it.

                  即使 Doctrine 将别名命名为 i__0,您也可以使用自定义别名访问该属性,例如$yourObject->num_a 将具有正确的值,即 count(p.product_id) 的结果.

                  Even though Doctrine names the alias i__0 you can access the attribute with your custom alias, e.g. $yourObject->num_a will have the proper value, namely the result of count(p.product_id).

                  查看查询的输出是一个有用的调试功能,但依赖应用程序内部是没有意义的,因为这些值仅用于 Doctrine 的内部机制.

                  To see the output of your query is a useful debug feature, but relying on in inside your application is non-sense since these values are only used for the internal mechanisms of Doctrine.

                  这篇关于为什么列别名在学说中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)
                    <tbody id='cXYc9'></tbody>
                  1. <i id='cXYc9'><tr id='cXYc9'><dt id='cXYc9'><q id='cXYc9'><span id='cXYc9'><b id='cXYc9'><form id='cXYc9'><ins id='cXYc9'></ins><ul id='cXYc9'></ul><sub id='cXYc9'></sub></form><legend id='cXYc9'></legend><bdo id='cXYc9'><pre id='cXYc9'><center id='cXYc9'></center></pre></bdo></b><th id='cXYc9'></th></span></q></dt></tr></i><div id='cXYc9'><tfoot id='cXYc9'></tfoot><dl id='cXYc9'><fieldset id='cXYc9'></fieldset></dl></div>
                      <bdo id='cXYc9'></bdo><ul id='cXYc9'></ul>
                      • <small id='cXYc9'></small><noframes id='cXYc9'>

                        <tfoot id='cXYc9'></tfoot>

                          <legend id='cXYc9'><style id='cXYc9'><dir id='cXYc9'><q id='cXYc9'></q></dir></style></legend>