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

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

WBOY
WBOYOriginal
2016-06-07 15:28:211398browse

例子: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中没有记录

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

Statement:
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