随笔分类 - MYSQL
摘要:当我们要查询id为1,2,3,4的数据的时候,可以用 IN操作,例如: 1 SELECT * from table where id in (1,2,3,4); 这时我有另外一个表里面的字段为A,存储的值为1,2,3,4,把它作为条件去查询的时候,那么语句就变成了 1 SELECT * from t
阅读全文
摘要:#create trigger 触发器名 触发时机 触发事件 on 表名 for each row#在USER表插入一行数据的时候,将表中的id字段中最大值的行插入path表中create trigger tri1 after insert on `user` for each rowBEGIN #
阅读全文
摘要:查看event是否开启: show variables like '%sche%'; 将事件计划开启: set global event_scheduler=1; 关闭事件任务: alter event e_test ON COMPLETION PRESERVE DISABLE; 开户事件任务: a
阅读全文
摘要:select * from table where datediff('2016-06-06',FROM_UNIXTIME(‘时间字段’, '%Y-%m-%d'))<=7 AND FROM_UNIXTIME('时间字段', '%Y-%m-%d') < date('2016-06-06'); FROM
阅读全文

浙公网安备 33010602011771号