1)删除某一个时间之前的记录
delete from cs_storage_video_file where date(start_time) <= '2017-10-27'
问题,目前只是支持精确到日,无法支持时分秒,如下指令删除异常
delete from cs_storage_video_file where date(start_time) <= '2017-10-27 09:00:00'
2)uuid函数提供一个默认的id
3)now函数提供当前的时间,格式是datetime
4) 格式化datetime返回一个日期的字符串
date_format(cs_alarm_templet.start_time,'%Y-%m-%d %H:%i:%s') as szstart_time
5) 格式化time返回一个时分秒的字符串
1. convert(cs_alarm_model_times.start_time, CHAR) as szstart_time
2. convert(cs_alarm_model_times.start_time, BINARY) as szstart_time
delete from cs_storage_video_file where date(start_time) <= '2017-10-27'
问题,目前只是支持精确到日,无法支持时分秒,如下指令删除异常
delete from cs_storage_video_file where date(start_time) <= '2017-10-27 09:00:00'
2)uuid函数提供一个默认的id
3)now函数提供当前的时间,格式是datetime
4) 格式化datetime返回一个日期的字符串
date_format(cs_alarm_templet.start_time,'%Y-%m-%d %H:%i:%s') as szstart_time
5) 格式化time返回一个时分秒的字符串
1. convert(cs_alarm_model_times.start_time, CHAR) as szstart_time
2. convert(cs_alarm_model_times.start_time, BINARY) as szstart_time
3. cast(cs_alarm_model_times.start_time AS CHAR) as szstart_time
本文转自fengyuzaitu 51CTO博客,原文链接:http://blog.51cto.com/fengyuzaitu/1976830,如需转载请自行联系原作者