A little difference between SQL Server 2005 and Oracle Syntax Summary _ database other

Source: Internet
Author: User
Tags current time getdate
1. Get System Current Time
SQL Server 2005:
Select GETDATE ()
Select Sysdate from dual
2. Get Year date
SQL Server 2005:
Copy Code code as follows:

Select year (GETDATE ())--2011
Select Month (getdate ())--3
Select Day (getdate ())--23

Copy Code code as follows:

Select To_char (sysdate, ' yyyy ') from dual--2011
Select To_char (sysdate, ' mm ') from dual--03
Select To_char (sysdate, ' DD ') from dual--23
Q Quarter
HH Hour (12)
Hh24 hours (24)
Mi min
SS seconds
Days of the week in D week
Related Article

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.