目前分類:常用SQL (5)

瀏覽方式: 標題列表 簡短摘要

NVL進階版函式

select Coalesce('C','B','A') from dual  ==> C

select Coalesce(null,'B','A') from dual  ==> B

select Coalesce(null,null,'A') from dual  ==> A

Somebaby 發表在 痞客邦 留言(0) 人氣()

  • Nov 26 Thu 2009 13:03
  • Chr表

Chr(0)

Null Chr(29) 分组符 Chr(38) & Chr(48) 0
Chr(8) 退格 Chr(30) 記錄分離符號 Chr(39) ' Chr(49) 1
Chr(9) Tab Chr(31) 單元分隔符號 Chr(40) ( Chr(50) 2
Chr(10) 换行 Chr(32) 空格SPACE Chr(41) ) Chr(51) 3
Chr(12) 换页 Chr(33) ! Chr(42) * Chr(52) 4
Chr(13) Enter

Chr(33)

! Chr(43) + Chr(53) 5
Chr(22) 粘贴 Chr(34) " Chr(44) , Chr(54) 6
Chr(26) 撤销 Chr(35) # Chr(45) - Chr(55) 7
Chr(27) Esc Chr(36) $ Chr(46) . Chr(56) 8
Chr(28) 文件分隔符 Chr(37) % Chr(47) / Chr(57) 9
Chr(58) : Chr(68) D Chr(78) N Chr(88) X
Chr(59) ; Chr(69) E Chr(79) O Chr(89) Y
Chr(60) < Chr(70) F Chr(80) P Chr(90) Z
Chr(61) = Chr(71) G Chr(81) Q Chr(91) [
Chr(62) > Chr(72) H Chr(82) R Chr(92) \
Chr(63) ? Chr(73) I Chr(83) S Chr(93) ]
Chr(64) @ Chr(74) J Chr(84) T Chr(94) ^
Chr(65) A Chr(75) K Chr(85) U Chr(95) _
Chr(66) B Chr(76) L Chr(86) V Chr(96) `
Chr(67) C Chr(77) M Chr(87) W Chr(97) a
Chr(98) b Chr(108) l Chr(118) v Chr(128)
Chr(99) c Chr(109) m Chr(119) w
Chr(100) d Chr(110) n Chr(120) x
Chr(101) e Chr(111) o Chr(121) y
Chr(102) f Chr(112) p Chr(122) z
Chr(103) g Chr(113) q Chr(123) {
Chr(104) h Chr(114) r Chr(124) |
Chr(105) i Chr(115) s Chr(125) }
Chr(106) j Chr(116) t Chr(126) ~
Chr(107) k Chr(117) u Chr(127) 删除
文章標籤

Somebaby 發表在 痞客邦 留言(4) 人氣()

監控資料庫效能

SELECT   s.username
       , s.SID
       , s.serial#
       , s.machine
       , TO_CHAR (sl.start_time, 'mm/dd/yyyy hh24:mi:ss') start_time
       , s.osuser
       , s.module
       , s.program
       , s.client_info
       , ROUND (sl.elapsed_seconds / 60) || ':'
         || MOD (sl.elapsed_seconds, 60) elapsed
       , ROUND (sl.time_remaining / 60) || ':' || MOD (sl.time_remaining, 60)
                                                                    remaining
       , ROUND (sl.sofar / sl.totalwork * 100, 2) progress_pct
       , sl.MESSAGE
    FROM v$session s
       , v$session_longops sl
   WHERE s.SID = sl.SID
     AND s.serial# = sl.serial#
     AND sl.time_remaining > 0
ORDER BY progress_pct DESC;

Somebaby 發表在 痞客邦 留言(0) 人氣()

 SELECT *
  FROM wf_item_activity_statuses wias, wf_process_activities wpa
  WHERE wias.process_activity = wpa.instance_id
-- AND   wpa.activity_name = 'PURCHASE RELEASE ELIGIBLE'
  AND   wias.item_type = 'OEOL'
  AND   wias.item_key  = to_char(2369510) -- order line id
-- AND   wias.activity_status = 'NOTIFIED';

Somebaby 發表在 痞客邦 留言(0) 人氣()

--目前資料庫的語系
SELECT *
  FROM nls_database_parameters
 WHERE parameter = 'NLS_CHARACTERSET';

--查詢目前資料庫名稱
SELECT NAME
  FROM v$database;

Somebaby 發表在 痞客邦 留言(0) 人氣()