插入多条记录:
insert into student(stu_id,stu_name) select id,name from stu;
添加字段
alter table student add bith varchar2(10);
创建序列
create sequence seq_name
start with 1
increment by
使用序列
insert into student values(seq_stuid.nextval,321602302,'小二','男',20,89,sysdate);
创建一个表并从另一个表中插入记录
create table stu2 as select stu_id,stu_num from student;
创建一张表并从另一张表插入表结构
create table stu3 as select stu_id,stu_num from student where 1=2;
设置表字段为空
update student set stu_sex='';
查询为空的记录
select * from student where stu_age is null;
查询不为空的记录
select stu_name from student where stu_age is not null;
链接查询结果并制定别名:
select firstname ||'.'|| lastname as 姓名
from xingming;
显示固定行数记录:
select firstname,lastname
from xingming
where rownum<2;
连接两张表的记录不去重复
select firstname ||':'|| lastname as 姓名1
from xingming1 union all
select firstname ||':'|| lastname as 姓名1
from xingming2