2008年2月11日

Oracle vs. MSSQL (Function)

雖然網路上可供參考的資源很多,但莫非定律總是精準地上演,因此,最好的方式還是透過自行整理過後放在Blog裡,才容易找得到。


OracleMSSQL
EXP
(求對數(e)或其n次方值,e=2.71828183...)
SELECT EXP(4) "e to the 4th power" FROM DUAL;
=============
e to the 4th power
----------------------
54.59815
SELECT EXP(198.1938327)
===================
1.18710159597953E+86
POWER
(求某數的n次方值)
SELECT POWER(3,2) "Result" FROM DUAL;
==================
Result
----------
9
SELECT POWER(2,3) ====================
8



REF:
1. http://download.oracle.com/docs/cd/B19306_01/server.102/b14195/sqlqr02.htm#i83304
2.
http://technet.microsoft.com/en-us/library/ms189826.aspx