標籤:http://blog.sina.com.cn/s/blog_601d1ce30100cyrb.html有兩個簡單例子,以說明 “exists”和“in”的效率問題1) select * from T1 where exists(select 1 from T2 where T1.a=T2.a) ; T1資料量小而T2資料量非常大時,T1<<T2 時,1) 的查詢效率高。2)
標籤:-函數 函數像一個黑盒子一樣(看不到裡邊的構造),有參數傳回值,可以為我們完成一定的功能。-單行 這種函數會對結果中的每一行計算一次,每行返回一個結果,單行概念區別於分組函數。單行函數主要分為以下五類:字元函數、數字函數、日期函數、轉換函式、通用函數;一、字元型函數---字元處理-大小寫轉換例子:寫一個SQL,將‘I love Sql‘轉換成全大寫,全小寫和首字母大寫的形式。SELECT UPPER (‘I love Sql‘),LOWER(‘I love
標籤:Oracle不支援直接通過Database Link複製遠端資料庫表的CLOB/BLOB欄位資料到本機資料庫。像如下的SQL是不能執行的。(ipop_topic表有一個CLOB的欄位)insert into ipop_topicselect * from [email protected] where application_id=1000但是,我們可以藉助全域暫存資料表,先把資料複製到暫存資料表,再從暫存資料表轉移到你的目的表。create global temporary
標籤:今天遇到一個關於SQL轉換成Oracle語句的問題,描述如下:select*from emp orderby deptno;select*from dept;Sql Server:update dept a set dname=(select top 1 ename from emp where deptno=a.deptno orderby sal)經過嘗試,尋找資料,得出下面轉換結果,不知道這樣是否可行:update dept a set dname=(with t
標籤:一【使用者】sys\system\sysman\scott1、查看資料庫所有使用者(dba_users資料字典):select username from dba_users;2、查看目前使用者:show user;3、啟用(解鎖)資料庫使用者:alter user username account
標籤:excel串連列名產生oracle注釋notes: A2為列名,B2為注釋="comment on column ColAgreementHeader."&A2&" is q‘{"&B2&"}‘;" 效果如下: comment on column table1.Id is q‘{PK}‘;comment on column table1.col1 is q‘{Counterparty Organization ID}‘;comment on
標籤:11、查詢oracle的串連數2select count(*) from v$session;32、查詢oracle的並發串連數4select count(*) from v$session where status=‘ACTIVE‘;53、查看不同使用者的串連數6select username,count(username) from v$session where username is not null group by username;74、查看所有使用者:8select *
標籤:ORA-28000: the account is locked-的解決辦法2009-11-11 18:51ORA-28000: the account is locked第1步:使用PL/SQL,登入名稱為system,資料庫名稱不變,選擇類型的時候把Normal修改為Sysdba;第2步:選擇myjob,查看users;第3步:選擇system,右擊點擊“編輯”;第4步:修改密碼,把“帳戶被鎖住”的勾去掉;第5步:點擊“應用&