select lpad('tech', 7, 'x') A,
substr('This is a test', 6, 2) B ,
ltrim('123123Tech123', '321') C,
replace('123tech123', '2', 'x') D,
trim(' tech ') E,
lower('Tech on the Net') F,
to_char(1211.73, '99.9') G,
to_char(1212.73, '9,999.99') H,
to_char(1213.73, '$9,000') I,
to_char(1213.73, '$9,999') J,
to_char(24, '000099') K,
to_char(sysdate, 'yyyy/mm/dd') L,
to_date('2003/07/09', 'yyyy/mm/dd') M,
to_date('070903', 'MMDDYY') N,
to_date('20020315', 'yyyymmdd') O,
to_number('1210.73', '9999.99') P,
to_number('546', '999') Q,
to_number('23', '90.999900') R,
to_timestamp('2003/12/13 10:13:18', 'YYYY/MM/DD HH:MI:SS') S,
decode(10000,
10000,
'IBM',
10001,
'Microsoft',
10002,
'Hewlett Packard',
'Gateway') T,
decode(10001,
10000,
'IBM',
10001,
'Microsoft',
10002,
'Hewlett Packard',
'Gateway') U,
decode(10002,
10000,
'IBM',
10001,
'Microsoft',
10002,
'Hewlett Packard',
'Gateway') V,
decode(996,
10000,
'IBM',
10001,
'Microsoft',
10002,
'Hewlett Packard',
'Gateway') W,
trunc(to_date('2009-09-03'), 'YEAR') X,
trunc(to_date('2009-09-03'), 'Q') Y,
trunc(to_date('2009-09-03'), 'MONTH') Z,
trunc(to_date('2009-09-03'), 'DDD') AA,
trunc(to_date('2009-09-03'), 'DAY') BB
from dual t
上記のsql文をデータベース中で実行した結果:
A xxxtech
B is
C Tech123
D 1x3tech1x3
E tech
F tech on the net
G #####
H 1,212.73
I $1,214
J $1,214
K 000024
L 2008/07/01
M 2003/07/09
N 2003/07/09
O 2002/03/15
P 1210.73
Q 546
R 23
S 03-12-13 10:13:18.000000000
T IBM
U Microsoft
V Hewlett Packard
W Gateway
X 2009/01/01
Y 2009/07/01
Z 2009/09/01
AA 2009/09/03
BB 2009/08/30
基本SQL関数
最新推荐文章于 2024-08-05 17:42:28 发布