软件工程师经常用到oracle 语句汇总

程序员经常用到oracle 语句汇总
to_char(num,'$999')
to_date('2009-01-01 13:00:00','YYYY-mm-dd hh24:mi:ss')
to_number($100,'$99')
NVL(num,0)

in(a,b,c)


max()
min()
avg()
sum()
count(*)
round(num,2)//四舍五入剩下两位,看第三位

group by num;
order by num desc/asc

having//对分组进行限制

like '%a'

薪水大于1200雇员 按部门编号分组后平均薪水大于1500 查询平均工资 倒叙进行排列

select deptno,avg(sal) from emp where sal>30 group by deptno having avg(sal)>40 order by avg(sal) desc


表 join 表 on 连接条件(适用非等值连接)
left join
right join
full join

create view v$ as
select * from student

create index ind on student(sno)
cascade

表约束:(unique ,default,not null ,primary key ,foreign key,)
sequence

create sequence seq;
seq.nextval

create or replace produre p
declare c