Home > Database > Mysql Tutorial > Mysql有无groupby对max函数查询结果的影响ResultSet中有无记录受

Mysql有无groupby对max函数查询结果的影响ResultSet中有无记录受

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:28:21
Original
1434 people have browsed it

例子:mysql测试结果,其他数据库不支持有组函数没group by SELECT MAX(SUBSTR(id,7,10)),id FROM t_ad_video WHERE SUBSTR(id,1,6) = '140116' 此结果resutl中是有一条记录的。 vcD4KPHA+zqqx3MPitMvW1srCx+m3osn60OjSqrzTyc9ncm91cCBiedfWvuQ8L3A+CjxwPlNF

例子:mysql测试结果,其他数据库不支持有组函数没group by

SELECT MAX(SUBSTR(id,7,10)),id FROM t_ad_video WHERE SUBSTR(id,1,6) = '140116'

\

此结果resutl中是有一条记录的。喎?http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+zqqx3MPitMvW1srCx+m3osn60OjSqrzTyc9ncm91cCBiedfWvuQ8L3A+CjxwPlNFTEVDVCBNQVgoU1VCU1RSKGlkLDcsMTApKSxpZCxTVUJTVFIoaWQsMSw2KSBkZCBGUk9NIHRfYWRfdmlkZW8gV0hFUkUgU1VCU1RSKGlkLDEsNikgPSA="140116' GROUP BY SUBSTR(id,1,6)


此时resultset中没有记录

以上只是举个例子说明这个问题,无实际意义

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template