SQL Function Reference: Oracle vs. SQL

Thanx to Dan McCulley for sending me this link.  For all of you out there have to interact with both Oracle and SQL this is a handy reference.

http://www.webucator.com/resources/sql/reference.html

*same for both databases
Math Functions
FunctionOracleSQL Server
Absolute valueABSABS
Arc cosineACOSACOS
Arc sineASINASIN
Arc tangent of nATANATAN
Arc tangent of n and mATAN2ATN2
Smallest integer >= valueCEILCEILING
CosineCOSCOS
Hyperbolic cosineCOSHCOT
Exponential valueEXPEXP
Round down to nearest integerFLOORFLOOR
Natural logarithmLNLOG
Logarithm, any baseLOG(N)N/A
Logarithm, base 10LOG(10)LOG10
Modulus (remainder)MODUSE MODULO (%) OPERATOR
PowerPOWERPOWER
Random numberN/ARAND
RoundROUNDROUND
Sign of numberSIGNSIGN
SineSINSIN
Hyperbolic sineSINHN/A
Square rootSQRTSQRT
TangentTANTAN
Hyperbolic tangentTANHN/A
TruncateTRUNCN/A
Highest number in listGREATESTN/A
Lowest number in listLEASTN/A
Convert number if NULLNVLISNULL

 

String Functions
FunctionOracleSQL Server
Convert character to ASCIIASCIIASCII
String concatenateCONCAT(expression + expression)
Convert ASCII to characterCHRCHAR
Return starting point of character in character string (from left)INSTRCHARINDEX
Convert characters to lowercaseLOWERLOWER
Convert characters to uppercaseUPPERUPPER
Pad left side of character stringLPADN/A
Remove leading blank spacesLTRIMLTRIM
Remove trailing blank spacesRTRIMRTRIM
Starting point of pattern in character stringINSTRPATINDEX
Repeat character string multiple timesRPADREPLICATE
Phonetic representation of character stringSOUNDEXSOUNDEX
String of repeated spacesRPADSPACE
Character data converted from numeric dataTO_CHARSTR
SubstringSUBSTRSUBSTRING
Replace charactersREPLACESTUFF
Capitalize first letter of each word in stringINITCAPN/A
Translate character stringTRANSLATEN/A
Length of character stringLENGTHDATALENGTH or LEN
Greatest character string in listGREATESTN/A
Least character string in listLEASTN/A
Convert string if NULLNVLISNULL

 

Date Functions
FunctionOracleSQL Server
Date addition(use +)DATEADD
Date subtraction(use -)DATEDIFF
Last day of monthLAST_DAYN/A
Time zone conversionNEW_TIMEN/A
First weekday after dateNEXT_DAYN/A
Convert date to stringTO_CHARDATENAME
Convert date to numberTO_NUMBER(TO_CHAR())DATEPART
Convert string to dateTO_DATECAST
Get current date and timeSYSDATEGETDATE()

 


Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

November 21. 2008 10:35 PM