摘要: <select id="queryRuralCodes" resultType="string" parameterType="map" useCache="false"> select id from <choose> <when test="type == '1'.toString()"> t1 阅读全文
posted @ 2022-04-14 15:46 浅笑19 阅读(160) 评论(0) 推荐(0) 编辑
摘要: -- 今天 SELECT DATE_FORMAT(NOW(),'%Y-%m-%d 00:00:00') AS '今天开始'; SELECT DATE_FORMAT(NOW(),'%Y-%m-%d 23:59:59') AS '今天结束'; -- 昨天 SELECT DATE_FORMAT( DATE 阅读全文
posted @ 2022-04-14 15:46 浅笑19 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 原符号 < <= > >= & ' " 替换符号 &lt; &lt;= &gt; &gt;= &amp; &apos; &quot; 阅读全文
posted @ 2022-04-14 15:45 浅笑19 阅读(52) 评论(0) 推荐(0) 编辑
摘要: MySQL中union和order by是可以一起使用的,但是在使用中需要注意一些小问题,下面通过例子来说明。首先看下面的t1表。 1、如果直接用如下sql语句是会报错:Incorrect usage of UNION and ORDER BY。 SELECT * FROM t1 WHERE use 阅读全文
posted @ 2022-04-14 15:44 浅笑19 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 用到的表: t1 t2 t1表 key1 v1 a 1 b 2 c 3 d 4 t2表 key2 v2 a 1 b 2 c 3 d 4 1 -- 左连接 select * from t1 left join t2 on key1 = key2; 2 -- 左连接 , t1-t2 select * f 阅读全文
posted @ 2022-04-14 15:40 浅笑19 阅读(202) 评论(0) 推荐(1) 编辑
摘要: 要将List对象集合转为map集合,可以通过stream流的形式快速实现转换: 异常: 意思为map中出现了重复的key,也就是说通过上述方法转map时,出现重复key并不会出现覆盖的情况,而是再次在map中添加一个重复的key,导致报错。 所以通过stream实现list转map时,要实现重复的k 阅读全文
posted @ 2022-04-14 15:36 浅笑19 阅读(3495) 评论(0) 推荐(0) 编辑
摘要: MySql explain语句的返回结果中,filtered字段要怎么理解? MySql5.7官方文档中描述如下: The filtered column indicates an estimated percentage of table rows filtered by the table co 阅读全文
posted @ 2022-04-14 15:33 浅笑19 阅读(1817) 评论(0) 推荐(2) 编辑