SQLServer 和Oracle常用函数对比
1
.绝对值
S:
select
abs
(
-
1
) value
O:
select
abs
(
-
1
) value
from
dual
2
.取整(大)
S:
select
ceiling
(
-
1.001
) value
O:
select
ceil(
-
1.001
) value
from
dual
3
.取整(小)
S:
select
floor
(
-
1.001
) value
O:
select
floor
(
-
1.001
) value
from
dual
4
.取整(截取)
S:
select
cast
(
-
1.002
as
int
) value
O:
select
trunc(
-
1.002
) value
from
dual
5
.四舍五入
S:
select
round
(
1.23456
,
4
) value
1.23460
O:
select
round
(
1.23456
,
4
) value
from
dual
1.2346
6
.e为底的幂
S:
select
Exp
(
1
) value
2.7182818284590451
O:
select
Exp
(
1
) value
from
dual
2.71828182
7
.取e为底的对数
S:
select
log
(
2.7182818284590451
) value
1
O:
select
ln(
2.7182818284590451
) value
from
dual;
1
8
.取10为底对数
S:
select
log10
(
10
) value
1
O:
select
log
(
10
,
10
) value
from
dual;
1
9
.取平方
S:
select
SQUARE
(
4
) value
16
O:
select
power
(
4
,
2
) value
from
dual
16
10
.取平方根
S:
select
SQRT
(
4
) value
2
O:
select
SQRT
(
4
) value
from
dual
2
11
.求任意数为底的幂
S:
select
power
(
3
,
4
) value
81
O:
select
power
(
3
,
4
) value
from
dual
81
12
.取随机数
S:
select
rand
() value
O:
select
sys.dbms_random.value(
相关文档:
我们可以通过START WITH . . . CONNECT BY . . .子句来实现SQL的 层次查询,而Oracle 10g 为其添加许多了新的伪列。十多年以来,Oracle SQL 具有依照层次关系进行查询的功能。例如,你可以指定一个起始条件,然后根据一个或多个连接条件来确定孩子行的内容。举例来说,现在假设我有一个表,里面记 ......
select * from TTable1 for update 锁定表的所有行,只能读不能写
2 select * from TTable1 where pkid = 1 for update 只锁定pkid=1的行
3 select * from Table1 a join Table2 b on a.pkid=b.pkid for update 锁定两个表的所有记录
4 select * from Table1 a join Table2 b on a.pki ......
author:skate
time:2010-05-13
1)If memory increases and you're 64-bit, e.g 8G to 16G, Oracle SGA and related parameters need adjust; So are some the Unix kernel parameters.
2)As for CPU related configuration, some parameters, based on CPU_co ......
什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name Type Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y
CITY VARCHAR2(20) Y
SQL> select * from test;
COUNTRY CITY
-------------------- --------------------
中国 台北
中国 香 ......
商业和数据库很多时候必须跨时区工作,从9i开始,oracle环境开始有了时区意识,通过指定数据库的时区和使用TIMESTAMP WITH TIME ZONE和TIMESTAMP WITH LOCAL TIME ZONE数据类型来实现该功能。
TIMESTAMP WITH TIME ZONE不会存储数据库时区,但是有一个指示用来说明该时间所使用的时区。TIMESTAMP WITH LOCAL TIME ZONE会同 ......