標籤:Oracle11g 會遇到這樣的問題,用exp整庫匯出的時候,會遇到這樣的問題,庫裡的空表沒辦法匯出select * from all_all_tables aa where aa.owner=‘User名大寫‘ ---查看使用者下所有表select * from all_tables t where t.owner = ‘User名大寫‘ and t.num_rows = 0;--查看使用者下所有空表好了,下面是處理方法指令碼:在命令視窗運行:set heading off;
標籤:1,添加表B ,和A表表結構相同(帶資料)create table B as select * from A;2,添加表B ,和A表表結構相同(不帶帶資料)create table B as select * from A where 1=2;3,存在一個表B和表A的表結構一致,將A中的資料複製給B表insert into B select * from A;4,存在一個表B和表A的表結構不一致,將A中的資料複製給B表insert into B (x1,x2,x3.
標籤:首先我們查詢oracle使用者下的所有表select * from all_tab_comments -- 查詢所有使用者的表,視圖等select * from user_tab_comments -- 查詢本使用者的表,視圖等select * from all_col_comments --查詢所有使用者的表的列名和注釋.select * from user_col_comments -- 查詢本使用者的表的列名和注釋select * from all_
標籤:1.集合運算:UNION運算子返回兩個集合去掉重複元素後的所有記錄。例:查詢屬於部門10與部門20的所有員工資訊。select * from emp where deptno=10union select * from emp where deptno=20;UNIONALL 返回兩個集合的所有記錄,包括重複的。例:查詢工資在500~1500或在1000~2000範圍的員工資訊(這是兩個工資層級)。select * from emp where sal between 500 and 15
標籤:oracle1.題目:找到薪水大於本部門平均薪水的員工。select ename from emp e1 where sal>(select avg(sal) from emp e2 where e1.deptno=e2.deptno);2.題目:找到員工表中工資最高的前三名的員工資訊思路:1)先按照工資排序查詢出資料 2)再把查詢出的資料當做一個表 3)再查詢這個表中的前三條資料select * from (select sal from emp