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(
相关文档:
Oracle外部身份认证研究
密码文件认证 操作系统认证 remote_login_passwordfile SQLNET.AUTHENTICATION_SERVICES &nb ......
(红色部分为修改内容)
第一步,在磁盘下建一个文件夹,注意不要有空格,否则oracle安装时会出现警告。
第二步,用于进入安装界面后,检测环境在安装文件夹里搜索 "refhost.xml",共2个文件。
用记事本打开,看到
<!--Microsoft Windows vista-->
<OPERATING_SYSTEM>
&l ......
2010-04-21 14:04
oracle中构造数组的例子:
declare
type t_varray is varray(4) of number;
arr t_varray;
begin
arr := t_varray(1,2,3,4);
for i in 1..arr.count loop
dbms_output.put_line(arr(i));
end loop;
end;
构造二维数组的例子:
declare
type t_varray ......
因为公司的掌上城市系统在多个地势同时上线,而为了让每个城市的3G快讯具有地势特色性,每个地势有自己单独的数据库系统,而每个地势的快讯又一些共同的,譬如突然出了一条国际新闻,那么是不是每个地势的后台编辑都要录入一遍,这样无疑是做了许多无用功,所以公司考虑架设一个总站,总站上有专门的人负责,每天负责录入一 ......
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 ......