일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 윈도우
- 오라클
- 티베로
- Date and Time Functions
- String Function and Operators
- Data and Time Functions
- 전자정부 표준프레임워크
- HTTP
- Oracle
- Tibero
- String Functions and Operators
- SVN
- Sring Functions and Operators
- MySQL
- 방화벽
- Date and Time Function
- String Functions and Date Operators
- 전자정부표준프레임워크
- Today
- Total
목록MySQL (149)
웹이야기
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)
FLOOR(X) Returns the largest integer value not greater than X. mysql> SELECT FLOOR(1.23), FLOOR(-1.23) ; +-------------+--------------+ | FLOOR(1.23) | FLOOR(-1.23) | +-------------+--------------+ | 1 | -2 | +-------------+--------------+ 1 row in set (0.00 sec) mysql> SELECT CEIL(1.23) ; +------------+ | CEIL(1.23) | +------------+ | 2 | +------------+ 1 row in set (0.00 sec) CEIL() 참조 https:/..
CONV(N, from_base, to_base) Converts numbers between different number bases. Returns a string representation of the number N, converted from base from_base to base to_base. Returns NULL if any argument is NULL. The argument N is interpreted as an integer, but may be specified as an integer or string. The minimum base is 2 and the maximim base is 36. If from base is a negative number, N is regard..
CEIL(X) CEIL() is a synonym for CEILING() CEILING(X) Returns the smallest integer value not less than X. mysql> SELECT CEILING(1.1) ; +--------------+ | CEILING(1.1) | +--------------+ | 2 | +--------------+ 1 row in set (0.00 sec) mysql> SELECT CEILING(1) ; +------------+ | CEILING(1) | +------------+ | 1 | +------------+ 1 row in set (0.00 sec) mysql> SELECT CEILING(-3.2); +---------------+ | ..
ABS(X) Returns the absolute value of X. This function is safe to use with BIGINT values. mysql> SELECT ABS(2) ; +--------+ | ABS(2) | +--------+ | 2 | +--------+ 1 row in set (0.25 sec) mysql> SELECT ABS(-32) ; +----------+ | ABS(-32) | +----------+ | 32 | +----------+ 1 row in set (0.01 sec)
MySQL 수학함수 정도 ??? Name Description ABS() Return the absolute value ACOS() Return arc cosine ASIN() Return arc sine ATAN() Return arc tangent ATAN2(), ATAN() Return the arc tangent of the two argument CEIL() Return the smallest integer value not less than the argument CEILING() Return the smallest integer value not less than the argument CONV() Convert numbers between different number bases COS()..