일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Oracle
- String Functions and Date Operators
- SVN
- 방화벽
- String Functions and Operators
- 윈도우
- String Function and Operators
- Sring Functions and Operators
- Tibero
- HTTP
- 오라클
- Data and Time Functions
- MySQL
- Date and Time Function
- 티베로
- 전자정부표준프레임워크
- Date and Time Functions
- 전자정부 표준프레임워크
- Today
- Total
목록분류 전체보기 (213)
웹이야기
MySQL 날짜함수, 시간함수 DATE_SUB() DATE_SUB(date, INTERVAL expr unit) DATE_ADD 참조. https://webobj.tistory.com/114 MySQL DATE_ADD(), DATE_SUB() MySQL 날짜함수, 시간함수 DATE_ADD(), DATE_SUB() - 날짜 더하기 , 빼기 DATE_ADD(date, INTERVAL expr unit) DATE_SUB(date, INTERVAL expr unit) 의 형태 These functions perform date arithmetic. The date a.. webobj.tistory.com
MySQL 날짜함수, 시간함수 DATE_FORMAT() - 날짜를 지정된 형태의 문자열로 바꾸어준다. DATE_FORMAT(date, format) 의 형태로 사용 Formats the date value according to the format string. The specifiers shown in the following table may be used in the format string. The % character is required before format specifier characters. The specifiers apply to other functions as well: STR_TO_DATE(), TIME_FORMAT(), UNIX_TIMESTAMP() Specifier Des..
MySQL 날짜함수, 시간함수 DATE_ADD(), DATE_SUB() - 날짜 더하기 , 빼기 DATE_ADD(date, INTERVAL expr unit) DATE_SUB(date, INTERVAL expr unit) 의 형태 These functions perform date arithmetic. The date argument specifies the starting date or datetime value. expr is an expression specifying the interval value to be added or substracted from the starting date. expr is evaluated as a string; It amy start with a - for neg..
MySQL 날짜함수, 시간함수 DATEDIFF() - 날짜의 차이를 구하는 함수. expr1 - expr2. DATEDIFF(expr1, expr2) DATEDIFF() returns expr1 - expr2 expressed as a value in days from one date to other. expr1 and expr2 are date or date-and-time expressions. Only the date parts of the values are used in the calculation mysql> SELECT DATEDIFF('2007-12-31 23:59:59','2007-12-30'); +----------------------------------------------+ | ..
MySQL 날짜함수, 시간함수 DATE() - 날짜를 추출 DATE(expr) 의 형태로 사용 Extract the date part of the date or datetime expression expr. mysql> SELECT DATE('2003-12-31 01:02:03'); +-----------------------------+ | DATE('2003-12-31 01:02:03') | +-----------------------------+ | 2003-12-31 | +-----------------------------+ 1 row in set (0.00 sec) mysql> SELECT DATE(NOW()); +-------------+ | DATE(NOW()) | +------------..
MySQL 날짜함수, 시간함수 CURTIME() - 현재시간을 return 해주는 함수 - 문자열 형태, 또는 numeric 형태로 return. CURTIME([fsp]) 의 형태 Returns the current time as a value in 'hh:mm:ss' or hhmmss format, depending on whether the functions is used in string or numeric context. The value is expressed in the session time zone. In the fsp argument is given to speicify a fractional seconds precision from 0 to 6, the return value incl..
MySQL 날짜함수, 시간함수 CURRENT_TIMESTAMP, CURRENT_TIMESTAMP() CURRENT_TIMESTAMP 또는 CURRENT_TIMESTAMP([fsp]) 의 형태 CURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonym for NOW() mysql> SELECT CURRENT_TIMESTAMP; +---------------------+ | CURRENT_TIMESTAMP | +---------------------+ | 2020-04-01 14:46:56 | +---------------------+ 1 row in set (0.00 sec) mysql> SELECT CURRENT_TIMESTAMP(); +----------------..
MySQL 날짜함수, 시간함수 CURRENT_TIME, CURRENT_TIME() CURRENT_TIME 또는 CURRENT_TIME([fsp]) 의 형태 CURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME()
MySQL 날짜함수 시간함수 CURRENT_DATE, CURRENT_DATE() CURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE()
MySQL 날짜함수, 시간함수 CURDATE() - 현재 날짜를 return. CURDATE() 형태로 사용 Retuns the current date as a value in 'YYYY-MM-DD' or 'YYYYMMDD' format, depending on whether the function is used in string or numeric context. mysql> SELECT CURDATE(); +------------+ | CURDATE() | +------------+ | 2020-04-01 | +------------+ 1 row in set (0.00 sec) mysql> SELECT CURDATE()+0; +-------------+ | CURDATE()+0 | +---------..
MySQL 날짜함수, 시간함수 CONVERT_TZ() CONVERT_TZ(dt, from_tz, to_tz) 의 형태 - 특정 시간에 대해 타임존(time zone)을 변경하여 변경된 시간을 return 하는 함수정도? CONVERT_TZ() converts a datetime value dt from the time zone given by from tz to the the time zone given by to_tz and returns the resulting value. This function retuns NULL if the arguments are invalid. If the value falls out the supported range of the TIMESTAMP type when co..
MySQL 날짜함수, 시간함수 ADDTIME() ADDTIME(expr1, expr2) 의 형태 ADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time or datetime expression, and expr2 is a time expression. mysql> SELECT ADDTIME('2007-12-31 23;59;59.999999', '1 1:1:1.000002'); +---------------------------------------------------------+ | ADDTIME('2007-12-31 23;59;59.999999', '1 1:1:1.000002') | +--------------------------..
MySQL 날짜함수, 시간함수 ADDDATE() ADDDATE(date, INTERVAL expr unit) 또는 ADDDATE(expr, days) 형태 When invoked with the INTERVAL form of the second argument, ADDDATE() is a synonym for DATE_ADD(). The related function SUBDATE() is a synonym for DATE_SUB(). For information on the INTERVAL unit argument. mysql> SELECT DATE_ADD('2001-01-02', INTERVAL 31 DAY); +-----------------------------------------+ | DATE..
Date and Time Functions 날짜 함수, 시간 함수 정도 되겠지 MySQL에 날짜와 시간에 관한 함수를 보니 약 60개정도가 있다. 사소하게 보이는 함수도 많고, 유용하게 보이는 것도 많고, 처음보는 것도 있고, 혹은 전혀 쓰지 않을 것 같은 것들도 있다. 이것들을 간단하게 정리해보려고 한다. Name Description ADDDATE() ADD time values (intervals) to a date value ADDTIME Add time CONVERT_TZ() Convert from one time zone to another CURDATE() Return the current date CURRENT_DATE(), CURRENT_DATE Synonyms for CURDATE() ..
TRUNCATE(X, D) Returns the number X, truncated to D decimal places. If D is 0, the result has no decimal point or fractional part. D can be negative to cause D digits left of the decimal point of the value X to become zero. mysql> SELECT TRUNCATE(1.223, 1); +--------------------+ | TRUNCATE(1.223, 1) | +--------------------+ | 1.2 | +--------------------+ 1 row in set (0.00 sec) mysql> SELECT TR..
SIN(X) Returns the sine of X, while X is given in radians. mysql> SELECT SIN(PI()); +------------------------+ | SIN(PI()) | +------------------------+ | 1.2246467991473532e-16 | +------------------------+ 1 row in set (0.03 sec)
SIGN(X) Returns the sign of the argument as -1, 0, or 1, depending on whether X is negative, zero, or positive. mysql> SELECT SIGN(-23), SIGN(0), SIGN(234) ; +-----------+---------+-----------+ | SIGN(-23) | SIGN(0) | SIGN(234) | +-----------+---------+-----------+ | -1 | 0 | 1 | +-----------+---------+-----------+ 1 row in set (0.00 sec)
ROUND(X), ROUND(X, D) Rounds the argument X to D decimal places. The rounding algorithm depends on the data type of X. D defaults to 0 if not specified. D can be negative to cause D digits left of the decimal point of the value X to become to zero. mysql> SELECT ROUND(-1.23); +--------------+ | ROUND(-1.23) | +--------------+ | -1 | +--------------+ 1 row in set (0.10 sec) mysql> SELECT ROUND(-1..
RAND([N]) Returns a random floating-point value v in the range 0
MOD(N, M) N % M N MOD M 3개의 코드는 동일하다. MOD = modulo 는 나눗셈의 나머지를 계산하는 수학적 연산. Modulo operation. Returns the remainder of N divided by M . mysql> SELECT MOD(234, 10), 234%10, 234 MOD 10 ; +--------------+--------+------------+ | MOD(234, 10) | 234%10 | 234 MOD 10 | +--------------+--------+------------+ | 4 | 4 | 4 | +--------------+--------+------------+ 1 row in set (0.00 sec)