原文:https://blog.csdn.net/weixin_42114097/article/details/88229140 select * from user where username like CONCAT('%',#{username},'%') ...
分类:
数据库 时间:
2020-08-06 11:53:11
阅读次数:
76
今天在看分库分表的时候突然想到了锁 现在我们就来看看锁 mysql举例: InnoDB引擎的行锁和表锁 表锁:不会出现死锁,发生锁冲突几率高,并发低。 行锁:会出现死锁,发生锁冲突几率低,并发高。 锁冲突:例如说事务A将某几行上锁后,事务B又对其上锁,锁不能共存否则会出现锁冲突。(但是共享锁可以共存 ...
分类:
其他好文 时间:
2020-08-04 18:17:50
阅读次数:
78
官网 https://clickhouse.tech/ quick start 进入下面目录,手工下载软件然后安装 https://repo.clickhouse.tech/rpm/lts/x86_64/或者直接下载这四个文件wget https://repo.clickhouse.tech/rpm ...
分类:
其他好文 时间:
2020-08-04 16:51:52
阅读次数:
85
LinQ高级查询、组合查询、IQueryable集合类型 LinQ高级查询: 1、模糊查询(包含) Repeater1.DataSource = con.car.Where(r =>r.name.Contains(s)).ToList(); 2、开头 Repeater1.DataSource = c ...
分类:
其他好文 时间:
2020-08-04 16:40:03
阅读次数:
74
一、exists和in (1)当B表的数据集小于A表的数据集时,用in优于exists SELECT * from A WHERE id in (SELECT id from B) 等价于: for select id from B for select * from A where A.id = ...
分类:
数据库 时间:
2020-08-04 11:25:39
阅读次数:
81
当前ID为5,读取上一条记录: SELECT * FROM A WHERE ID < 5 ORDER BY ID DESC LIMIT 0,1; ps: select * from table1 where id<$id order by id desc limit 1 当前ID为5,读取下一条记录 ...
分类:
数据库 时间:
2020-08-03 23:34:06
阅读次数:
134
where、set、trim 三个标签都是为了解决 MyBatis 在动态生成 SQL 时,产生了多余的前缀和后缀的问题。 where实例 <select id="selectUserByIdAndName" resultType="com.imooc.mybatis.model.User"> SE ...
分类:
其他好文 时间:
2020-08-01 12:32:23
阅读次数:
62
foreach 标签用来遍历数组、列表和 Map 等集合参数,常与 in 关键字搭配使用。 遍历列表 <select id="selectUserInIds" resultType="com.imooc.mybatis.model.User"> SELECT * FROM imooc_user WH ...
分类:
其他好文 时间:
2020-08-01 12:31:14
阅读次数:
60
在注解中使用动态 SQL 其实十分简单,只需在动态 SQL 语句的外面包上一层script标签即可。如下: @Select({"<script>", "SELECT * FROM imooc_user", " WHERE", " <choose>", " <when test='id != null ...
分类:
其他好文 时间:
2020-08-01 12:30:26
阅读次数:
59