oracle删除一个用户下的表的sql语句是什么啊
删除用户所有表declarecursor c1 is select table_name from dba_tables where owner='REPORT';beginfor c2 in c1 loopexecute immediate 'drop table REPORT.'||c2.table_name;end loop;end; 或者select 'truncate table REPORT.'||table_name||';'from all_tables where owner='REPORT';(效率高)select 'drop table REPORT.'||table_name||';'from all_tables where owner='REPORT';(效率低)。
ORACLE 删除表中数据的sql语句求助
正确答案:
delete from rt_switch_monitor
where alarm_state = '165'
and cur_value = '1'
and parent_description = '开封地区/明河变/斯威夫特E40电源/明河变斯威夫特E40电源';
commit;
按照你的写法并纠正你的错误语句,应该为:
delete from rt_switch_monitor t
where t.alarm_state = '165'
or t.cur_value = '1'
t.parent_description in
(select t.parent_description from rt_switch_monitor t where t.parent_description = '开封地区/明河变/斯威夫特E40电源/明河变斯威夫特E40电源');
记得给我分!!!要知道我给别人培训,收的费用是相当高的(给你纠正只收悬赏分)
oracle删除数据语句怎么写
Oracle数据删除语句--查看当前SCN数值SELECT dbms_flashback.get_system_change_number from dual;--Scn与时间的对应关系SELECT to_char(sysdate,'yyyy-mm-dd hh24:mi:ss', to_char(DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER) AS SCN from dual;--通过时间flashback query数据www.2cto.com SELECT * FROM scott.test AS OF TIMESTAMP TO_TIMESTAMP('2013-11-17 10:25:17', 'YYYY-MM-DD HH:MI:SS'); --通过SCN 闪回数据SELECT * FROM scott.test AS OF SCN 23565583;--闪回表中误删除的数据flashback table tablename to timestamp xxx flashback table tablename to scn xxx--闪回表前提条件--该表需开启行移动功能,可在恢复之前打开再执行恢复alter table test enable row movement;。