鼎鼎知识库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2021.2.3好用的sql语句.md 797B

BEGIN
SELECT SUM(power),yyyymmdd FROM powers WHERE monthweekday="HOURS" AND StartTime<=STR_TO_DATE(yyyymmdd,'%Y%m%d%H') AND EndTime>=STR_TO_DATE(yyyymmdd,'%Y%m%d%H') GROUP BY yyyymmdd;
END
select count(*) from breakerdatas where mac='98CC4D213004'
select count(*) from breakerdatas where mac='187ED53338C4'
select count(*) from breakerdatas where mac='187ED53159E4'
select count(*) from breakerdatas where mac='98CC4D213003'

delete from breakerdatas where mac='187ED53338C4' and str_to_date(CreateTime, '%Y-%m-%d %H:%i:%s') <= str_to_date('2021-02-23 18:54:00', '%Y-%m-%d %H:%i:%s')

select CreateTime, mac, addr from  breakerdatas where mac='187ED53338C4' and addr='1' and str_to_date(CreateTime, '%Y-%m-%d %H:%i:%s') >= str_to_date('2021-02-23 19:30:00', '%Y-%m-%d %H:%i:%s')