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--
ORACLE Date and Time Functions
Date and character conversion function usage (to_date,to_char)
select to_char(sysdate,'y-mm-dd hh34:mi: ss') as nowTime from dual; //date converted to string
select to_char(sysdate,'y') as nowYear from dual; //get the year of the time
select to_char(sysdate,'mm') as nowMonth from dual; //get month of time
select to_char(sysdate,'dd') as nowDay from dual; //get the day of the time
select to_char(sysdate,'hh34') as nowHour from dual; //get time when
select to_char(sysdate,'mi') as nowMinute from dual; //Get the minutes of the time
select to_char(sysdate,'ss') as nowSecond from dual; //Get the seconds of the time
Ask what day of the week it is.
SQL> select to_char(to_date('2015-10-27','yyyy-mm-dd'),'day') from dual;
TO_CHA
------
Tuesday
Number of days between two days
SQL> select floor(sysdate - to_date('20020405','yyyymmdd')) from dual;
FLOOR(SYSDATE-TO_DATE('20020405','YYYYMMDD'))
---------------------------------------------
4949
Date of treatment
select older_date,
newer_date,
years,
months,
abs(
trunc(
newer_date-
add_months( older_date,years*12+months )
)
) days from ( select
trunc(months_between( newer_date, older_date )/12) YEARS,
mod(trunc(months_between( newer_date, older_date )),12 ) MONTHS,
newer_date,
older_date
from (
select hiredate older_date, add_months(hiredate,rownum)+rownum newer_date
from emp
)
)
Ways to deal with the uncertainty of the number of days in the month
select to_char(add_months(last_day(sysdate) +1, -2), 'yyyymmdd'),last_day(sysdate) from dual
Original address; plat.delit.cn/thread-183-1-1.html
Please indicate the source of the reprint;
Written by Metrology www.delit.cn
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.