查詢
SELECT COUNT(*) FROM v$session;
SELECT COUNT(*) FROM v$process;
SELECT value FROM v$paramter WHERE name = 'processes';
Big Bear 發表在 痞客邦 留言(0) 人氣(290)
TO_CHAR(0.56, '999990.9') = 0.6
TO_CHAR(0, '999990.9') = 0.0
ROUND(0.56, 1) = 0.6 --還有 floor 無條件捨去
ROUND(0, 1) = 0.0
Big Bear 發表在 痞客邦 留言(0) 人氣(565)
create or replace type array_type as varray(2000) of varchar2(1000);
Big Bear 發表在 痞客邦 留言(0) 人氣(69)

connect string
需加在DB Server
的中
Big Bear 發表在 痞客邦 留言(0) 人氣(110)
Grade_table
SUBJECT
|
STUDENT_ID
|
GRADE
|
Chemistry
|
1
|
60
|
Chemistry
|
2
|
65
|
Mathematics
|
1
|
80
|
Mathematics
|
2
|
85
|
Mathematics
|
3
|
90
|
Mathematics
|
4
|
95
|
Mathematics
|
5
|
100
|
Physics
|
1
|
85
|
Physics
|
2
|
90
|
Geography
|
1
|
95
|
Big Bear 發表在 痞客邦 留言(0) 人氣(47)
create or replace function GetWeekOfYear(dt Timestamp)
return number
is
weekOfYear number;
begin
select ceil
(
(
to_number(to_char(dt, 'DDD')) -
(8 - to_char(trunc(dt, 'YYYY'), 'D'))
) / 7 + 1
) into weekOfYear from dual;
return weekOfYear;
end GetWeekOfYear;
Big Bear 發表在 痞客邦 留言(0) 人氣(1,454)
1. 變數用法
varName1 := 0; --將varName1設為零
varName1 := varName1 + 1; --將varName1+1
varName2 := paramter1;
Big Bear 發表在 痞客邦 留言(0) 人氣(1,275)
查詢DB執行中的物件:
SELECT *
FROM v$db_object_cache
WHERE locks > 0 AND pins > 0 AND type = 'PROCEDURE' --type = 查看哪種類型物件
Big Bear 發表在 痞客邦 留言(0) 人氣(1,224)
Sale_table
ID
|
Sale
|
a
|
5
|
b
|
6
|
c
|
7
|
a
|
8
|
Big Bear 發表在 痞客邦 留言(0) 人氣(5,659)
Grade_table
SUBJECT
|
STUDENT_ID
|
GRADE
|
Chemistry
|
1
|
60
|
Chemistry
|
2
|
65
|
Mathematics
|
1
|
80
|
Mathematics
|
2
|
85
|
Mathematics
|
3
|
90
|
Mathematics
|
4
|
95
|
Mathematics
|
5
|
100
|
Physics
|
1
|
85
|
Physics
|
2
|
90
|
Geography
|
1
|
95
|
Big Bear 發表在 痞客邦 留言(0) 人氣(44)