oracle学习记录之五--第8讲

来源:互联网 发布:北京工业大学网络教育 编辑:程序博客网 时间:2024/05/19 06:17

1.表的自我复制

insert into student ( xh, xm ,age)  select * from student;


2.不显示重复列

select xh, distinct xm from student;


3.将null值表为0;

select ename, sal*12+nvl(comm,0) from emp;      --nvl(comm, 0); 


distinct 用法

--作用于单列

select distinct job from emp;  

--作用于多列

select distinct job, ename, sal from emp;  --distinct作用多列查询,只要有一列不同,则该条记录就与其他不同而显示




原创粉丝点击