Common oracle and sqlserver functions: decode (c1, A, y1, B, y2 ....) // c1 is the prerequisite, A is the comparison object, y1 is the result object, B is the comparison object, and y2 is the result object. Equivalent to case when (..) and (..) then .. else .. end from table mathematical functions ----------------------------------------------- select abs (-3.00) from dual O: abs absolute value function S: ceil to take the entire big O: ceiling to take the entire big O: floor rounded up small S: trunc rounded up truncated O: cast rounded up truncated O: round rounded up S: round rounded down to O: greatest Set max S: max set maximum value www.2cto.com O: least set minimum value S: min set minimum value O: INSTR substring position S: CHARINDEX substring position O: substr substring S: substring O: replace substrings instead of returning S: STUFF substrings instead of returning O: No S: REPLICATE repeated string date functions --------------------------------------------- O: sysdate system date S: getdate () system date O: sysdate () + n // Date addition and subtraction S: getdate () + n // Date addition and subtraction O: select trunc (sysdate) from dual // evaluate Date O: select to_char (sysdate, 'yyyy-mm-dd') // evaluate the date S: select convert (char (10), getdate (), 20) // evaluate the date O: select to_char (sysdate, 'hh24: mm: ss') // obtain the time S: select convert (char (8), getdate (), 108) // obtain the time O: SELECT To_date ('1970-01-2004: 09: 38', 'yyyy-mm-ddhh24-mi-ss ') // date to string S: select cast ('1970-09-08' as datetime) // convert date to string
Author 409304740