Common usage of Oracle data function

1, string functions
lower () uppercase small letter
upper () uppercase lowercase turn
INITCAP () initials, all lowercase characters other
concat () connecting the two values, it is equivalent to ||. Note: The value passed to allow two parameters.
substr () String taken
usage see
string functions link
2, numerical functions
numerical functions link
3, date function
(1) to the last day of the month can be determined
LAST_DAY (date): find the specified date belongs to the last day of the month ;
find the current time on the last day where the month of
the SELECT LAST_DAY (sysdate) the FROM Dual
(2) ~ seeking the next week the specified date the week the X-
NEXT_DAY (date, 'week X');
seek next Wednesday time
select next_day (sysdate, 'Wednesday') the FROM Dual
(. 3) X ~ find the specified date months after the date
ADD_MONTH (date, X)
seeking four months after
the SELECT the ADD_MONTHS (SYSDATE,. 4) the FROM Dual;
(. 4) to obtain the specified ~ number of months between the date and time specified
MONTHS_BETWEEN (X, Y)
seeking up to now the number of employees hired months
select ename,trunc(months_between(sysdate,HIREDATE)) 雇佣月数 FROM EMP

Published 14 original articles · won praise 15 · views 327

Guess you like

Origin blog.csdn.net/weixin_42970847/article/details/103395249