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

声明:http://www.dezai.cn/blog/blogview.asp?logID=196
德仔工作室---Web开发乐园 分享超过2万篇的Web开发教程

http://www.dezai.cn  脚踏实地 用心努力
posted @ 2008-05-10 23:22 德仔--脚踏实地 用心努力 阅读(26) 评论(0)  编辑 收藏

标题  
姓名  
主页
Email (只有博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
 
另存  打印