Home >Database >Mysql Tutorial >查询一个月最后一天的总用户数,数据库中没有保存最好一天的数据

查询一个月最后一天的总用户数,数据库中没有保存最好一天的数据

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 15:56:561380browse

select total_user from a_user_no where date_time=(select max(date_time) from a_user_no where ‘2013-05’ '=to_char(date_time,‘yyyy-mm’)); 通过max 函数来去5月份出现最大日期的数据

select total_user from a_user_no where date_time=(select max(date_time) from a_user_no where
‘2013-05’+ "'=to_char(date_time,‘yyyy-mm’));

通过max 函数来去5月份出现最大日期的数据

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
Previous article:MongoDB第一弹Next article:sqlserver备份恢复一例