日期:2014-05-20 浏览次数:20832 次
with t as( select '实习牧师' a,'Lv9' b from dual union all select 'AI~非主流文文','起床成功' from dual union all select '拎砖四顾心茫然','浪客剑心' from dual union all select 'ToFishes','大胡子' from dual union all select '被X了的BUG','零波凌' from dual union all select '梦幻七彩瓶','ChanelA哆啦梦' from dual ) select wm_concat(b)over(order by a,b) from t
CREATE GLOBAL TEMPORARY TABLE QCUI_Temp_Trans2 ON COMMIT DELETE ROWS3 AS4 SELECT * FROM t_Department;
CREATE GLOBAL TEMPORARY TABLE QCUI_Temp_Sess2 ON COMMIT PRESERVE ROWS3 AS4 SELECT * FROM t_Department;
with t as( select '1' id, '1' item, 'A' name, '100' amount from dual union all select '1' id, '2' item, 'B' name, '30' amount from dual union all select '1' id, '3' item, 'A' name, '50' amount from dual union all select '1' id, '4' item, 'B' name, '90' amount from dual union all select '2' id, '1' item, 'A' name, '90' amount from dual union all select '2' id, '2' item, 'B' name, '40' amount from dual union all select '2' id, '3' item, 'C' name, '140' amount from dual) SELECT id,item,name,amount from ( SELECT id,item,name,amount, row_number() over(partition by id order by amount desc ) r1 from( SELECT id,item,name,sum(amount) over(partition by id,name) amount from t ) tt ) WHERE r1=1
TYPE items_type IS TABLE OF v_unit_items%ROWTYPE; unit_all_items items_type; SELECT * BULK COLLECT INTO unit_all_items FROM v_unit_items --这样就可以通过 For i In 1..unit_all_items.Last Loop --来进行读取数据了。
exp system/manager@TEST file=d:\daochu.dmp full=y
create database link sdyy_wz connect to sdyy_wz identified by "sdyy_wz" using '(DESCRIPTION = (ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.2)(PORT = 1521)) ) (CONNECT_DATA =(SERVICE_NAME = hbmaindb) ) )';
SELECT osuser, username, sql_text from v$session a, v$sqltext b where a.sql_address =b.address order by address, piece;
select a.file_id "FileNo",a.tablespace_name "Tablespace_name", round(a.bytes/1024/1024,4) "Total MB", round((a.bytes-sum(nvl(b.bytes,0)))/1024/1024,4) "Used MB", round(sum(nvl(b.bytes,0))/1024/1024,4) "Free MB", round(sum(nvl(b.bytes,0))/a.bytes*100,4) "%Free" from dba_data_files a, dba_free_space b where a.file_id=b.file_id(+) group by a.tablespace_name, a.file_id,a.bytes order by a.tablespace_name