-
j上课笔记。。。
查看全部 -
Tcp查看全部
-
通过【UNION ALL 】将左右连接关联
查看全部 -
SQL正确使用的重要性?
增加数据库处理效率,减少应用等待时间
减少数据服务器负载,提高服务器稳定性
节省服务器间通讯的网络流量
查看全部 -
1、常见的sql语句类型
DDL:数据定义语言;
TPL:事务处理语言;
DCL:数据控制语言;
DML:数据操作语言(最常用到的)select\insert\update\delete
查看全部 -
我记的笔记查看全部
-
常见的SQL语句类型
DDL
TPL
DCL
DML
查看全部 -
select d.user_name,c.timestr,kills from (
select user_id,timestr,kills,(select count(*) from user_kills b where b.user_id=a.user_id and a.kills<=b.kills) as cnt from user_kills a
group by user_id,timestr,kills
) c join user1 d on c.user_id=d.id where cnt <= 2
查看全部 -
SQLserver/Oracle/Pgsql 中的优化方式
查看全部 -
根据表关联修改字段
update table1 set column='{test}' where table1.column in (select b,column from table1 a join table2 b on a.column=b.column)
根据上述查询,数据库会报错,优化
update table1 a join (select b,column from table1 a inner join table2 b on a.column=b.column) b on a.column=b.column set a.column='{test}'
查看全部 -
mysql中使用full join
就需要间接使用
left join union all right join 的联合使用
查看全部 -
join类型
内连接 inner join
全外连接 full outer join
左外连接 left outer join
右外连接 right outer join
交叉连接 cross join
查看全部 -
正确使用SQL很重要吗?
※ 增加数据库处理效率,减少应用相应时间
※ 减少数据库服务器负载,增加服务器稳定性
※ 减少服务器间通讯的网络流量
查看全部 -
1、使用子查询
select a.user_name,b.timestr,b.kills
from user1 a join user_kills b
on a.id=b.user_id
where b.kills =(select max(c.kills) from user_kills c where c.user_id = b.user_id)
2、使用join避免子查询
select a.user_name,b.timestr,b.kills
from user1 a
join user_kills b on a.id=b.user_id
join user_kills c on c.user_id = b.user_id
group by a.user_name,b.timestr,b,kills
having b.kills=max(c.kills)
查看全部 -
1、使用连接(join) 通常要比使用单纯的子查询耗用的时间更短
查看全部
举报