Wednesday 6 October 2010

SQL Function Reference: Oracle vs. SQL Server

NICE LINK : http://www.sql-ref.com/


*same for both databases
Math Functions
Function Oracle SQL 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
Standard deviation STDDEV STDEV
Variance VARIANCE VAR
String Functions
Function Oracle SQL 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
Function Oracle SQL Server
Date addition (use +) DATEADD
Date subtraction (use -) DATEDIFF
Last day of month LAST_DAY N/A
Time zone conversion NEW_TIME N/A
First weekday after date NEXT_DAY N/A
Convert date to string TO_CHAR DATENAME
Convert date to number TO_NUMBER(TO_CHAR()) DATEPART
Convert string to date TO_DATE CAST
Get current date and time SYSDATE GETDATE()

No comments:

Post a Comment

Azure OpenAI Architecture Patterns & Deployment Patterns

Sharing some useful links that will help customers architect Azure OpenAI solution using the best practices: (1) Azure OpenAI Landing Zone r...