我正在使用以下查询
SELECT count(*) as num,id,page_name FROM project_page where p_id = '256'
此查询在 mysql 版本 5.1.49-3 上运行良好,并在 mysql 5.0.32-Debian_7etch8-log 上出错在两台服务器上,我有完全相同的数据库.
this query is running fine on mysql version 5.1.49-3 and giving error on mysql 5.0.32-Debian_7etch8-log On both server i have exactly same database.
错误信息
#1140 - 如果没有 GROUP BY 子句,将 GROUP 列 (MIN(),MAX(),COUNT(),...) 与没有 GROUP 列的混合是非法的
如何在 5.0.31 上运行上述查询而没有任何错误
How do i run the above query on 5.0.31 without any error
请帮忙.
添加... GROUP BY num, id, page_name
这篇关于Mysql:聚合功能在没有 group by 的情况下不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
获取所有产品、类别和元数据的 SQL 查询 woocommSQL query to get all products, categories and meta data woocommerce/wordpress(获取所有产品、类别和元数据的 SQL 查询 woocommerce/wordpre
如何在 WSL(Linux 的 Windows 子系统)中使用 MySQL?How to use MySQL in WSL (Windows Subsystem for Linux)?(如何在 WSL(Linux 的 Windows 子系统)中使用 MySQL?)
任务计划程序中的 PowerShell MySQL 备份脚本错误 PowerShell MySQL Backup Script Error in Task Scheduler 0x00041301(任务计划程序中的 PowerShell MySQL 备份脚本错误 0x00041301)
将数据从 XML 文件导入 MySQL 数据库Import the data from the XML files into a MySQL database(将数据从 XML 文件导入 MySQL 数据库)
在 Windows 7 32 位上安装 Xampp.启动时的错误installed Xampp on Windows 7 32-bit. Errors when starting(在 Windows 7 32 位上安装 Xampp.启动时的错误)
Windows xampp 上的 Mysql 小写表Mysql lower case table on Windows xampp(Windows xampp 上的 Mysql 小写表)