In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. The number of days is obtained by subtracting the two dates.
Datediff (day,a.alsdate,a.aledate)
2. Date field conversion
2019-04-100 09For 30 purl 11.000
CONVERT (char (10), Emp_pydate, 120) AS Emp_pydate-- converted to 2019-04-10
YEAR (Emp_pydate) AS Pydate_Year-converted to 2019
MONTH (Emp_pydate) AS Pydate_Month-convert to April
DAY (Emp_pydate) AS Pydate_Day-convert to 10 days
3. Get the current date
GETDATE ()
4. Add or subtract a specified time interval from a date
DATEADD (datepart,number,date)
The date parameter is a valid date expression.
Number is the number of intervals you want to add; for future times, it is positive, and for past times, it is negative.
The datepart parameter can be the following values:
Year: yy,yyyy
Quarter: qq, Q
Month: mm, m
Day: dd, d
Hours: hh
DATEADD (mm, 12, Emp_pydate)-2019-04-10 date + 12 months = 2020-04-10
DATEADD (day,2,Emp_pydate)-2019-04-10 date + 2 days = 2019-04-12
5. How many days of the year is a certain date?
Datepart (dayofyear,Emp_pydate)-- 2019-04-10 = 100th day of 2019 dayofyear is the number of days of the year
Datepart (yy,Emp_pydate)-2019-04-10 datepart 2019 is the acquisition year
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.