Common oracle and sqlserver Functions

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.