Differences between oracle and SQL (common functions) (4) ORACLE functions
BitsCN.com
Ual
41. a day of the week (such as Sunday)
S: unknown
O: SELECT Next_day (sysdate, 7) vaule from dual;
42. string conversion time
S: can be directly converted to or select cast ('2017-09-08 'as datetime) value
O: SELECT To_date ('2017-01-05 22:09:38 ', 'yyyy-mm-dd hh24-mi-ss') vaule from dual;
43. calculate the difference of a part of the two dates (for example, seconds)
S: select datediff (ss, getdate (), getdate () + 12.3) value O: subtract directly with two dates (such as D1-D2 = 12.3)
SELECT (D1-D2) * 24*60*60 vaule from dual;
44. calculate a new date (for example, minute) based on the difference value)
S: select dateadd (mi, 8, getdate () value
O: SELECT sysdate + 8/60/24 vaule from dual;
45. time in different time zones
S: unknown
O: SELECT New_time (sysdate, 'ydt ', 'gmt') vaule from dual;
----- Time zone parameter. Beijing must be in the East 8 zone of Ydt -------
Ast adt standard Atlantic Time
Bst bdt Standard Time
Standard time for central CST CDT
Est edt standard Eastern time
GMT Standard Time
Hst hdt Alaska-Hawaii Standard Time
Standard time for mst mdt mountainous areas
NST standard time for new Finland
Pst pdt Pacific Standard Time
Yst ydt yukon Standard Time
Character functions supported by Oracle and their Microsoft SQL Server equivalent functions:
Functions: Oracle Microsoft SQL Server
Convert characters to ASCII
CONCAT (expressi limit n + expressi limit n)
Convert ASCII to CHR CHAR
Returns the Start character (from the left) instr charindex in the string.
Convert characters to LOWER-case LOWER
Convert character to uppercase UPPER
Fill the left lpad n/A of the string
Clear the starting blank LTRIM
Clear trailing blank RTRIM
INSTR PATINDEX
Repeat the string rpad replicate multiple times
Voice representation of the string SOUNDEX
Repeat the SPACE string RPAD SPACE
Convert numeric data to character data TO_CHAR STR
SUBSTRING SUBSTR SUBSTRING
REPLACE STUFF
Capital the first letter of each word in the string. initcap n/
Translation string translate n/
String LENGTH: DATELENGTH or LEN
The largest string in the list: greatest n/
The smallest string in the list, least n/.
BitsCN.com