UNION和UNION_ALL的区别
在数据库中,UNION和UNION ALL关键字都是将两个结果集合并为一个,但这两者从使用和效率上来说都有所不同。UNION在进行表链接后会筛选掉重复的记录,所以在表链接后会对所产生的结果集进行排序运算,删除重复的记...
查看主键约束
select * from user_constraints where constraint_type='P' and TABLE_name=upper('table_name')
删除重复记录
delete from random r1 where r1.rowid<(select max(rowid) from random r2 where r1.id=r2.id);
点滴
set autocommit on放在glogin.sql里,这样不用每次打开SQP*PLUS都得设置
Session如果没有执行commit会自动提交吗?
首先来看正常exit sqlplus的情况 SQL> create tablespace remen datafile 'e:\oracle\oradata\ora9\remen01.dbf' size 10m; 表空间已创建。 SQL> create user remen identified by remen defau...