首頁  >  文章  >  資料庫  >  查询一个月最后一天的总用户数,数据库中没有保存最好一天的数据

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

WBOY
WBOY原創
2016-06-07 15:56:561291瀏覽

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

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn