1、获得数据库里某个指定的库
SELECT COUNT(*) FROM ALL_TABLES ut WHERE ut.OWNER='TJFX' AND ut.TABLE_NAME = 'CUR_TIME_BILL';
2、创建一个表,里面的数据可以从一个已存在的表里转移过来
CREATE TABLE temptable AS SELECT * FROM old_tbName
//使用现有的表创建一个新表的结构不带数据(创建一个表的副本不带数据)
create table copy_route_header as select * from route_header where 1=2;
如不带条件相当于复制一张表
create table copy_route_header as select * from route_header ;
3 、将某个表里的某个字段插入到当前表的某个字段
INSERT INTO table_A(col_1)SELECT table_B.col_1 table_B WHERE table_B.col_1 IS NOT NULL GROUP BY table_B.col_1
4、更新某个表里的多个字段等于指定表里的对应字段的数据内容
UPDATE (SELECT esc.NET_FLAG as a1,'||flag||' as a2,esc.DEVICE_TYPE as a3,'||dType||' as a4 FROM ECP_SECTIONNO_CALLED esc WHERE esc.PHONECODE LIKE '''||section_text||'%'') SET a1=a2,a3=a4
select owner,object_name from dba_objects where object_type='DATABASE LINK';