dao: public List<Favorite> findRidByUid(int uid) { String sql="select * from tab_favorite where uid=?"; return jdbcTemplate.query(sql,new BeanProperty ...
分类:
其他好文 时间:
2020-05-19 01:03:39
阅读次数:
59
1. explain是什么 使用explain关键字可以模拟优化器执行SQL查询语句,从而知道MySQL是如何处理你的SQL语句的,分析你的查询语句或是表结构的性能瓶颈。 2. explain能干吗 可用于分析: 表的读取顺序 数据读取操作的操作类型 哪些索引可以使用 哪些索引被实际使用 表之间的引 ...
分类:
数据库 时间:
2020-05-19 00:30:18
阅读次数:
105
所谓连表查询就是把两张表连接在一起之后,就变成一张大表,从from开始一直到on条件结束就看做一张表 之后可以用where条件 group by 分组 order by limit 都可以正常的使用 子查询: select dep_id from employee group by dep_id h ...
分类:
其他好文 时间:
2020-05-19 00:27:04
阅读次数:
101
题目 Given a sequence of K integers { N?1?? , N?2?? , ..., N?K?? }. A continuous subsequence is defined to be { Ni?? , N?i+1?? , ..., N?j?? } where 1≤i≤ ...
分类:
其他好文 时间:
2020-05-18 22:37:14
阅读次数:
57
Oracle 通过一个表字段,更新另一个表字段: 方法一:通过update实现 update g_sn_status A set A.out_process_time = (select B.rec_time from g_sn_defect B where B.serial_number = A. ...
分类:
数据库 时间:
2020-05-18 20:43:53
阅读次数:
98
本周有个优化sql任务,有一条sql慢查询,起初看了下感觉并没有什么问题,但是就是出现了慢查询,后来细究后发现了问题: sql:select id, name, mtime, .... from a force index (mtime) where id >= ? and mtime >= ? a ...
分类:
数据库 时间:
2020-05-18 20:35:43
阅读次数:
187
insert into 表名(待插入字段1,待插入字段2,...,待插入字段n) select '张三','1',...,'袜子' from 表名 a where not exists(select 1 from 表名 b where b.判断条件字段1='张三' and b.判断条件字段2='1' ...
分类:
数据库 时间:
2020-05-18 18:46:49
阅读次数:
196
基本操作 # 获取所有数据,对应SQL:select * from User User.objects.all() # 匹配,对应SQL:select * from User where name = '运维咖啡吧' User.objects.filter(name='运维咖啡吧') # 不匹配,对 ...
分类:
其他好文 时间:
2020-05-18 16:49:08
阅读次数:
52
前期准备 准备好srt字幕文件 格式例如: 100:00:04,990 --> 00:00:07,759for a long time now I've been wanting to 200:00:07,759 --> 00:00:11,690shoot an episode where I di ...
分类:
编程语言 时间:
2020-05-18 16:44:54
阅读次数:
113
查询表student中的所有数据:select * from student; 只查询表student中的id和name:select id,name from student; 把重复的行删除,在select后面及字段的前面加distinct:如 条件 使用where子句对表中的数据筛选,结果为t ...
分类:
数据库 时间:
2020-05-18 16:20:31
阅读次数:
58