随笔分类 -  数据库

mybatis中insert插入之后返回主键useGeneratedKeys="true" keyProperty="id"
摘要:useGeneratedKeys="true" keyProperty="id" <insert id="InsertYyzz" parameterType="java.util.Map" useGeneratedKeys="true" keyProperty="id"> INSERT INTO b 阅读全文

posted @ 2017-05-12 10:39 lc_smile36 阅读(3863) 评论(0) 推荐(0)

mysql中把日期转换成周几的函数DAYOFWEEK()
摘要:比如2017-04-26为周三 得到结果为4 周日--1 周一--2 周二--3 周三--4 周四--5 周五--6 周日--1 select DAYOFWEEK('2017-04-26') ; 结果为4 阅读全文

posted @ 2017-04-26 15:10 lc_smile36 阅读(2191) 评论(0) 推荐(0)

mysql数据库中吧时分秒换算成秒的函数TIME_TO_SEC()
摘要:表 tab id time 1 00:01:30 比如 00:01:30 SELECT TIME_TO_SEC(time) FROM tab where id=1 得到的结果就是 90 阅读全文

posted @ 2017-04-26 15:05 lc_smile36 阅读(1661) 评论(0) 推荐(0)

MySQL:日期函数、时间函数总结
摘要:原文:http://www.51sdj.com/phpcms/picture/2009/0711/picture_133.html 一、MySQL 获得当前日期时间 函数1.1 获得当前日期+时间(date + time)函数:now()mysql> select now(); + +| now() 阅读全文

posted @ 2017-04-26 15:02 lc_smile36 阅读(286) 评论(0) 推荐(0)