摘要:
一、一些常用的SQL实践 (1)负向条件查询不能使用索引 select * from order where status!=0 and stauts!=1 not in/not exists都不是好习惯 可以优化为in查询: select * from order where status in( 阅读全文
摘要:
① 同一年的情况下计算工作日函数 CREATE DEFINER=`root`@`%` FUNCTION `WORKDAYSONEYEAR`(`datefrom` datetime,`dateto` datetime) RETURNS int(20) NO SQL BEGIN declare days 阅读全文
摘要:
背景 今天准备调试一个很久没打开的项目时,页面无法展示信息,经排查是因为数据库停止,查看运行状态发现以下异常。 Jun 15 15:30:58 sccprocduat10 systemd[1]: Started LSB: start and stop MySQL. Jun 15 15:30:59 s 阅读全文
摘要:
1.初始化表和测试数据 CREATE TABLE t1 SELECT 1 AS a, 'c3' AS b, 'c2' AS c; ALTER TABLE t1 CHANGE a a INT PRIMARY KEY AUTO_INCREMENT ; INSERT INTO t1 SELECT 2,'2 阅读全文
摘要:
描述 我们先看一段使用了并行流的代码 @Test public void testStream() { List<Integer> list = new ArrayList<>(); for (int i = 0; i < 10000; i++) { list.add(i); } System.ou 阅读全文