摘要: 一、Mysql 1、Mysql 批量删除表数据 SELECT CONCAT('delete from ',table_name,';') FROM information_schema.`TABLES` WHERE table_schema='数据库名'; 2、复制表结构及表数据 create ta 阅读全文
posted @ 2021-08-03 11:36 唏嘘- 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 1、基本语法 SELECT * FROM table LIMIT [offset,] rows | rows OFFSET offset; 如果只给定一个参数,表示记录数。 SELECT * FROM table LIMIT 5; //检索前5条记录(1-5) 相当于 SELECT * from t 阅读全文
posted @ 2021-08-03 11:15 唏嘘- 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 1、方法一:遍历 String[] arr = { "0asd", "1zxc", "2vf", "3fg", "4zz", "5yy" }; // 遍历 StringBuffer str = new StringBuffer(); for (int i=0; i<arr.length; i++) 阅读全文
posted @ 2021-08-02 10:56 唏嘘- 阅读(2047) 评论(0) 推荐(0) 编辑
摘要: 1、html <input type="text" id="birthdayBegin1" field="birthday" operator=">=" autocomplete="off" class="layui-input dateType1" style="position:absolute 阅读全文
posted @ 2021-07-31 09:38 唏嘘- 阅读(767) 评论(0) 推荐(0) 编辑
摘要: 1、UUID函数 在MySQL中,可以用uuid()函数来生成一个UUID select UUID() from dual 2、replace函数 默认生成的uuid含有'-',我们可以使用replace函数替换掉'-',SQL如下: select REPLACE(UUID(),"-","") as 阅读全文
posted @ 2021-07-26 17:49 唏嘘- 阅读(5215) 评论(0) 推荐(0) 编辑
摘要: 在oracle8i以后提供了一个生成不重复的数据的一个函数sys_guid()一共32位, 生成的依据主要是时间和机器码,具有世界唯一性,类似于java中的UUID(都是世界唯一的)。 应用场景:当数据库某字段设置为唯一,可用此生成主键; 例如: select sys_guid() from dua 阅读全文
posted @ 2021-07-26 17:10 唏嘘- 阅读(624) 评论(0) 推荐(0) 编辑
摘要: %Y 年, 数字, 4 位 %y 年, 数字, 2 位 %m 月, 数字(01……12) %H 小时(00……23) %h 小时(01……12) %i 分钟, 数字(00……59) %S 秒(00……59) 把日期转为字符串格式 进行查询 select * from staff where DATE 阅读全文
posted @ 2021-07-26 16:53 唏嘘- 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 字符串转日期 select to_date(birthday, 'yyyy-mm-dd') from staff 日期转字符串 select to_char(to_date(birthday, 'yyyy-mm-dd'), 'yyyy"年"mm"月"dd"日"') from staff 先将orac 阅读全文
posted @ 2021-07-21 17:27 唏嘘- 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Oracle 语法 IN 后集合 不能超过1000, IN 的个数建议控制在 200 以内。 select * from table where id in ( '1' , ' ', ' ',.........,'1000') 解决方式 1、分多次查询,最大不超过 1000, 然后将结果汇总 2、把 阅读全文
posted @ 2021-07-21 16:27 唏嘘- 阅读(1087) 评论(0) 推荐(0) 编辑
摘要: Mybatis-Plus 使用 数据库不存在的字段,可在实体类的属性加上 @TableField 注解 @TableField(exist=false) 阅读全文
posted @ 2021-07-19 16:00 唏嘘- 阅读(947) 评论(0) 推荐(0) 编辑