国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > Oracle > 正文

Oracle學(xué)習(xí)筆記(五)

2020-07-26 14:31:53
字體:
供稿:網(wǎng)友
組合集總計(jì):
group by with rollup/cube
grouping sets
子查詢按執(zhí)行方式分:標(biāo)準(zhǔn)子查詢、關(guān)聯(lián)子查詢
標(biāo)準(zhǔn)子查詢:嵌套子查詢
標(biāo)量值查詢
case with then
使用exits查詢
select user_id,user_name from tb_001 tb
where [not] exists (select 'x'
from tb_001
where manager_id=tb.user_id )
關(guān)聯(lián)更新
update table1 alias1
set column=(select expression
from table2 alias2
where alias1.column=alias2.column);
關(guān)聯(lián)刪除
delete from table1 alias11
where column operator
(select expression
from table2 alias2
where alias1.column=alias2.column);
分層結(jié)構(gòu)
分層檢索
select [level],column,expr...
from table
[where with condition(s)]
[connect by prior condition(s)]
connect by prior column1=column2
top down:
colum1=parentkey
column2=childkey
bottom up:
column1=childkey
column2=parentkey

插入語句insert statement
insert into table[(column[,column...])]
values(value[,value...])
修改語句update statement
update table
set column=value[,column=value,...]
[where condition];

多表插入語句(Multitable Insert Statements)

insert [all] [conditional_insert_clause]
[insert_into_cause values_clause](subquery)
conditional_insert_clause
[all][first]
[when condition then][insert_into_clause values_clause]
[else][insert_into+clause values_clause]
列:
intsert all
into tb_user values(id,uid,upwd)
into tb_user_info values(id,name,sex,age)
select id,uid,upwd,name,sex,age
from tb_u_10
where id>10000;
待條件的多行插入
insert all
when id>11000 then
into tb_user values(id,uid,upwd)
when age>40 then
into tb_user_info values(id,name,sex,age)
select id,uid,upwd,name,sex,age
from tb_u_10
where id>10000;
insert first
when conditional then
into ...
when conditional then
into ...
else
into...
select...
創(chuàng)建索引
cretate table t_10
(id number(6) not null primary key using index (create index index1 on t_10(id)),
name varchar2(50));
查詢索引
select * from user_indexes;
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 盘山县| 泾川县| 英超| 德州市| 黄石市| 陆丰市| 九寨沟县| 合阳县| 陈巴尔虎旗| 曲松县| 凤城市| 灵宝市| 凤庆县| 泽库县| 司法| 桃园县| 镇巴县| 旌德县| 卢湾区| 尚义县| 定日县| 玛纳斯县| 宣威市| 余姚市| 汉阴县| 邳州市| 旬阳县| 新和县| 延吉市| 涪陵区| 汉源县| 安西县| 许昌县| 商城县| 莲花县| 台湾省| 锦州市| 黑龙江省| 东山县| 沧州市| 铅山县|