mysql date_format的使用

来源:互联网 发布:java中什么是常量 编辑:程序博客网 时间:2024/06/05 04:26

(%Y-%m-%d %H:%i:%s)年月日,时分秒

select id,content,is_read,DATE_FORMAT(create_date,'%Y-%m-%d %H:%i:%s') create_date  from lcs_notice where del_flag=0 and id=? and user_uuid=?

(%Y-%m-%d %H:%i) 年月日,时分

select count(*) num from bee_activity_shala where date_format(start_date,'%Y-%m-%d %H:%i') <='2016-01-01 00:01' and date_format(end_date,'%Y-%m-%d %H:%i') >= '2016-01-31 23:59' 

(%Y-%m-%d)年月日

select count(id) num from bee_order where del_flag=0 and date_format(profit_date,'%Y-%m-%d') >= '2016-01-14' and date_format(profit_date,'%Y-%m-%d') <= '2016-01-20'
原创粉丝点击