
| Function | Description |
|---|---|
| UCASE | μλ¬Έμ λλ¬Έμλ‘ λ³ννλ ν¨μ |
| LCASE | μλ¬Έμ μλ¬Έμλ‘ λ³ννλ ν¨μ |
| MIN | λ¬Έμμ΄ λΆλΆμ λ°ννλ ν¨μ |
| LENGTH | λ¬Έμμ΄μ κΈΈμ΄λ₯Ό λ°ννλ ν¨μ |
| ROUND | μ§μ ν μ리μμ μ«μλ₯Ό λ°μ¬λ¦Όνλ ν¨μ (0μ΄ μμμ 첫째μ리) |
| NOW | νμ¬ λ μ§ λ° μκ°μ λ°ννλ ν¨μ |
| FORMAT | μ«μλ₯Ό μ²λ¨μ μ½€λ§κ° μλ νμμΌλ‘ λ°ννλ ν¨μ |
UCASE λ¬Έλ²
select ucase('string')
LCASE λ¬Έλ²
select lcase('string')
MID λ¬Έλ²
select mid('string', start_position, lenth)
string : μλ³Έ λ¬Έμμ΄
start_position : λ¬Έμμ΄ λ°ν μμ μμΉ(첫κΈμ 1, λ§μ§λ§κΈμ -1)
lenth : λ°νν λ¬Έμμ΄ κΈΈμ΄
LENGTH λ¬Έλ²
select length('string') //곡백λ ν¬ν¨
-null μ null
ROUND λ¬Έλ²
select round(number, decimal_place)
number : λ°μ¬λ¦Όν λμ
decimal_place : λ°μ¬λ¦Όν μμμ μμΉ(option)
// λ°μ¬λ¦Όν μμΉλ₯Ό μ§μ νμ§ μμ κ²½μ°, (0)μμ λ°μ¬λ¦Ό
NOW λ¬Έλ²
select now()
FORMAT λ¬Έλ²
select format(number, decimal_place)
number : ν¬λ§·μ μ μ© ν λ¬Έμ νΉμ μ«μ
decimal_place : νμν μμμ μμΉ
// μμμ μ νμνμ§ μμ κ²½μ° 0
- cafe table
create table cafe ( type varchar(8), menu varchar(32), price int, ranking int );
select ucase(type) type,lcase(menu) menu
from cafe;
select menu, mid(menu,-4,4) from cafe
where ranking = 6;
select truncate(avg(length(menu)),1) avg from cafe;
select menu, format(price,0) price from cafe;
μ€μ΅νμΈ
![]() | ![]() | ![]() | ![]() |
|---|