-
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) 通常要比使用單純的子查詢耗用的時間更短
查看全部
舉報