摘要: /** * 获取日期时间的年份,如2017-02-13,返回2017 * * @param date * @return */public static int getYear(Date date) { Calendar cal = Calendar.getInstance(); cal.setTi 阅读全文
posted @ 2021-11-16 10:23 游走人间的蒲公英 阅读(77) 评论(0) 推荐(0) 编辑
摘要: /** * 获取两个日期(不含时分秒)相差的天数,不包含今天 * * @param startDate * @param endDate * @throws ParseException * @return */public static int dateBetween(Date startDate 阅读全文
posted @ 2021-11-16 10:21 游走人间的蒲公英 阅读(54) 评论(0) 推荐(0) 编辑
摘要: /** * 获取两个时间中最大的一个时间 * * @param date * @param compareDate * @return */public static Date dateMax(Date date, Date compareDate) { if (date == null) { re 阅读全文
posted @ 2021-11-16 10:20 游走人间的蒲公英 阅读(307) 评论(0) 推荐(0) 编辑
摘要: /** * 获取两个时间中最小的一个时间 * * @param date * @param compareDate * @return */public static Date dateMin(Date date, Date compareDate) { if (date == null) { re 阅读全文
posted @ 2021-11-16 10:19 游走人间的蒲公英 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-08-26 15:21 游走人间的蒲公英 阅读(23) 评论(0) 推荐(0) 编辑
摘要: -- 方法1 使用DATE_FORMAT DATE_FORMAT(time, '%Y-%m-%d') -- 方法2 使用 CAST CAST(time AS DATE) 阅读全文
posted @ 2021-08-26 09:57 游走人间的蒲公英 阅读(3278) 评论(0) 推荐(0) 编辑
摘要: -- 转换年 CREATE_TIME 需要转换的字段 TO_CHAR(CREATE_TIME / (1000 * 60 * 60 * 24) + TO_DATE('1970-01-01 08:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'YYYY') -- 转换年-月 CRE 阅读全文
posted @ 2021-08-26 09:28 游走人间的蒲公英 阅读(3082) 评论(0) 推荐(0) 编辑
摘要: /** 修改序列 、第一步删除序列第二步创建序列**/ -- 删除序列DROP SEQUENCE USER; -- 创建序列CREATE sequence USERminvalue 1maxvalue 9999999999999999999999999999start with 200increme 阅读全文
posted @ 2021-08-25 16:26 游走人间的蒲公英 阅读(899) 评论(0) 推荐(0) 编辑
摘要: -- 数据最后一位加1 :UPDATE 表名 SET 列名=列名||'要添加的字符 UPDATE users set name=name||'1'; -- 数据最开始一位加1 :UPDATE 表名 SET 列名=列名||'要添加的字符 UPDATE users set name='1'||name; 阅读全文
posted @ 2021-08-25 16:20 游走人间的蒲公英 阅读(2276) 评论(0) 推荐(0) 编辑
摘要: -- RETURN_REASON --alter table tablename add (column datatype [default value][null/not null],….);--alter table [表名] add 字段名 int default 0 增加数字字段,长整型,缺 阅读全文
posted @ 2021-08-25 16:13 游走人间的蒲公英 阅读(1130) 评论(0) 推荐(0) 编辑