1、尋找一個表的主鍵和索引極其它們的欄位查主鍵名稱: select CONSTRAINT_NAME from user_constraints where table_name ='abc' and constraint_type ='P'; 查主鍵對應的列: select COLUMN_NAME from user_cons_columns where table_name = 'abc' and constraint_name =
row_number() OVER (PARTITION BY COL1 ORDER BY COL2) 表示根據COL1分組,在分組內部根據 COL2排序,而此Function Compute的值就表示每組內部排序後的順序編號(組內連續的唯一的). 與rownum的區別在於:使用rownum進行排序的時候是先對結果集加入偽列rownum然後再進行排序,而此函數在包含排序從句後是先排序再計算行號碼. row_number()和rownum差不多,功能更強一點(可以在各個分組內從1開時排序).
一.安裝LogMiner$ sqlplus /nologSQL*Plus: Release 10.2.0.3.0 - Production on Tue Apr 15 12:30:58 2008Copyright (c) 1982, 2006, Oracle. All Rights Reserved.SQL> conn / as sysdba;Connected to an idle instance.SQL> startupORACLE instance
在搞資料庫時,發現有這樣的一個欄位,類型是NUMBER(38),查看了一下裡面的資料,都是這樣的,1323957678114132132699429513221293068041322129716220猜到應該是1970年1月1號0點0分距現在的毫秒值。解決辦法是寫一個轉換函式:create or replace function num_to_date(in_number NUMBER) return date isbegin
由於串連查詢時可能會出現一條對應多條的情況:如A表與B表串連查詢,A.id有可能對應B.id多個結果,如果這樣寫:update ( select A.id as var,B.id as value from A,B where A.key = B.nokey)set var=value;如果在B表的nokey欄位上建一個唯一索引,我猜想應該能行(有時間下去試試)不多說了,這裡給我實際工作中用到的一個例子: update (select /*+
The Roundtable Summations: 11 Views on Java's Biggest ChallengesIndustry technologists set the agenda for Java directions in the year ahead by Dan Rub http://www.ftponline.com/javapro/2003_06/online/roundtable_03_06_25/ At the close of the 2003 Java
為了確定資料表空間中包含那些內容,運行:select owner,segment_name,segment_type from dba_segments where tablespace_name='<name of tablespace>' 查詢資料表空間包含多少資料檔案。select file_name, tablespace_name from dba_data_files where tablespace_name ='<name of tablespace>
方括弧表達示方括號運算式描述[[:alnum:]]字母和數字混合的字元[[:alpha:]]字母字元[[:cntrl:]]控制字元[[:digit:]]數字字元[[:graph:]]映像字元[[:lower:]]小寫字母字元[[:print:]]列印字元[[:punct:]]標點符號字元[[:space:]]空白字元[[:upper:]]大寫字母字元[[:xdigit:]]十六進位數字字元 為了便於記憶:分別做下英文的解釋:alnum is short for alphabet