Oracle基本操作语句(二)

(1)插入数据
/单行/
insert into scott.emp(empno,ename,hiredate) values(1000,'jack','20-10月-2008');
/批量/
insert into scott.emp(empno,ename,hiredate)(select empno+100,ename,hiredate from scott.emp);

(2)表复制

create table  scott.dztest as (select distinct empno,ename,hiredate from scott.emp where empno>=7000);

(3)删除数据

delete from scott.emp where scott.ename='ward';

(4)删除整表数据

truncate table scott.dztest;

(5)更新数据

update scott.emp set ename='dezai' where ename='ward';

(6)嵌套更新

update scott.emp set ename=(select sal from scott.emp where  scott.sal='4000') where empno=1245

上一篇: Oracle基本操作语句一
下一篇: 面对灾难,我们能做什么??
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: 5625
发表评论
昵 称:
密 码: 游客发言不需要密码.
邮 箱: 邮件地址支持Gravatar头像,邮箱地址不会公开.
网 址: 输入网址便于回访.
内 容:
验证码:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 30 字 | UBB代码 关闭 | [img]标签 关闭