查找指定用户下的表
select t.table_name from user_tables t where owner = 'username';
ORACLE查看某个表空间里有哪些表
select TABLE_NAME,TABLESPACE_NAME from dba_tables where TABLESPACE_NAME='表空间名';
Oracle查询视图定义
select text from user_views where view_name='视图名称';
更新某一列值为另一个表的某列值
update table1 set (table1.column1) = (select table2.column2 from table2 where table1.column1 = table2.column2)
where exists (select 1 from table2 where table1.column1 = table2.column2);
把一个表数据插入另一个表
INSERT INTO 目标表(字段1, 字段2, ...)SELECT 字段1, 字段2, ... FROM 来源表 WHERE 条件;
查找不包含某些字符串 regexp_like
select t.table_name from user_tables t where NOT regexp_like( t.table_name, '^(CJXX_|DEMO_CUSTOMER|HISTORY_|LHZB_|ORG_|SYS_|WF_|ZB_|ZJPS_|ZYPS_)');
ceil和floor函数
ceil(n) 取大于等于数值n的最小整数;
floor(n)取小于等于数值n的最大整数;