白名单:数据 id , g_id,sys_id 1,2,3 1,2,4 黑名单:数据 id , g_id,sys_id b,2,3 结果 1,2,4 select t1.* from sys_baimingdan t1 where not exists (select 1 from sys_heimingdan t2 where t1.sys_id = t2.sys_id and t1.g_ID = t2.g_ID…
-- 查询字段在什么表 select * from all_tab_cols t where t.column_name='ABC'; -- 查询字段在什么表并且 判断是否是主键 select * from all_tab_cols t left join ( select a.table_name, a.constraint_name, a.column_name, b.constraint_type -- 字段约束类型(P:主键) from user_cons_columns a inner…
set unused的用法(ORACLE删除字段) 一.问题 现场有一张大数据量的分区表,数据量在10G以上.因某种原因需要删除其中的某些字段.如果直接用alter table1 drop (column1,column2);或者alter table1 drop column column1;和alter table1 drop column column2; 的话,需要执行很长时间,这期间该表被锁,会影响到其它应用. 二.解决方法 使用set unused,等系统空闲时再drop unuse…