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

      <bdo id='WlK5w'></bdo><ul id='WlK5w'></ul>
    <legend id='WlK5w'><style id='WlK5w'><dir id='WlK5w'><q id='WlK5w'></q></dir></style></legend>
  2. <tfoot id='WlK5w'></tfoot>

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

      SELECT 列表不在 GROUP BY 子句中并且包含非聚合列

      时间:2023-08-18
    1. <small id='1HR0s'></small><noframes id='1HR0s'>

        <legend id='1HR0s'><style id='1HR0s'><dir id='1HR0s'><q id='1HR0s'></q></dir></style></legend>

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

            <bdo id='1HR0s'></bdo><ul id='1HR0s'></ul>
          • <tfoot id='1HR0s'></tfoot>

                本文介绍了SELECT 列表不在 GROUP BY 子句中并且包含非聚合列......与 sql_mode=only_full_group_by 不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                在带有 WAMP 服务器的 Windows PC 上使用 MySQL 5.7.13 的 AM

                AM using MySQL 5.7.13 on my windows PC with WAMP Server

                我的问题是在执行这个查询时

                Here my Problem is While executing this query

                SELECT *
                FROM `tbl_customer_pod_uploads`
                WHERE `load_id` = '78' AND
                      `status` = 'Active'
                GROUP BY `proof_type`
                

                总是出现这样的错误

                SELECT 列表的表达式 #1 不在 GROUP BY 子句中,并且包含非聚合列returntr_prod.tbl_customer_pod_uploads.id",该列在功能上不依赖于 GROUP BY 子句中的列;这与 sql_mode=only_full_group_by 不兼容

                Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'returntr_prod.tbl_customer_pod_uploads.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

                你能告诉我最好的解决方案吗...

                Can you please tell me the best solution...

                我需要像这样的结果

                +----+---------+---------+---------+----------+-----------+------------+---------------+--------------+------------+--------+---------------------+---------------------+
                | id | user_id | load_id | bill_id | latitude | langitude | proof_type | document_type | file_name    | is_private | status | createdon           | updatedon           |
                +----+---------+---------+---------+----------+-----------+------------+---------------+--------------+------------+--------+---------------------+---------------------+
                |  1 |       1 | 78      | 1       | 21.1212  | 21.5454   |          1 |             1 | id_Card.docx |          0 | Active | 2017-01-27 11:30:11 | 2017-01-27 11:30:14 |
                +----+---------+---------+---------+----------+-----------+------------+---------------+--------------+------------+--------+---------------------+---------------------+
                

                推荐答案

                这个

                SELECT 列表的表达式 #1 不在 GROUP BY 子句中,并且包含非聚合列returntr_prod.tbl_customer_pod_uploads.id",该列在功能上不依赖于 GROUP BY 子句中的列;这与 sql_mode=only_full_group_by 不兼容

                Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'returntr_prod.tbl_customer_pod_uploads.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

                通过这个命令改变MySQL中的sql模式就可以解决了,

                will be simply solved by changing the sql mode in MySQL by this command,

                SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
                

                这对我也有用..我用了这个,因为在我的项目中有很多这样的查询所以我只是把这个sql模式改成了only_full_group_by

                This too works for me.. I used this, because in my project there are many Queries like this so I just changed this sql mode to only_full_group_by

                OR 仅包含 SELECT 语句指定的 GROUP BY 子句中的所有列.sql_mode 可以保持启用状态.

                OR simply include all columns in the GROUP BY clause that was specified by the SELECT statement. The sql_mode can be left enabled.

                谢谢... :-)

                这篇关于SELECT 列表不在 GROUP BY 子句中并且包含非聚合列......与 sql_mode=only_full_group_by 不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何使用日期范围填充表格? 下一篇:按 SQL IN() 子句中值的顺序排序

                相关文章

                最新文章

                  <tfoot id='dhg8Q'></tfoot>

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

                1. <legend id='dhg8Q'><style id='dhg8Q'><dir id='dhg8Q'><q id='dhg8Q'></q></dir></style></legend>
                    <bdo id='dhg8Q'></bdo><ul id='dhg8Q'></ul>

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