欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Oracle基础教学:各类语句及函数讲解

程序员文章站 2022-12-06 20:21:37
1.select语句 2.数据操纵语言(dml语句) insert, update, delete 3.数据定义语言(ddl语句) create, alter, drop, rename, trun...

1.select语句

2.数据操纵语言(dml语句)

insert, update, delete

3.数据定义语言(ddl语句)

create, alter, drop, rename, truncate

4.事务控制语句

commit, rollback, savepoint

5.数据控制语言(dcl语句)

grant【授权】, revoke【回收】

单值函数

组函数

聚合函数

分析函数

开窗函数

分析函数

row_number() over(partition by … order by …)

rank() over(partition by … order by …)

dense_rank() over(partition by … order by …)

count() over(partition by … order by …)

max() over(partition by … order by …)

min() over(partition by … order by …)

sum() over(partition by … order by …)

avg() over(partition by … order by …)

first_value() over(partition by … order by …)

last_value() over(partition by … order by …)

lag() over(partition by … order by …)

lead() over(partition by … order by …)

select id,name,date1 from (select id,name,date1,row_number() over(partition by id order by date1 desc) as rn from t1)t where t.rn=1;