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

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

WBOY
Release: 2016-06-07 15:56:56
Original
1367 people have browsed it

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月份出现最大日期的数据

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template