
์ฌ๋ฌ ๋ฌธ์์ด์ ํ๋๋ก ํฉ์น๊ฑฐ๋ ์ฐ๊ฒฐ
์นผ๋ผ์ด๋ ํ ์ด๋ธ ์ด๋ฆ์ ๋ณ์นญ ์์ฑ
๊ฒ์ํ ๊ฒฐ๊ณผ์ ์ค๋ณต ์ ๊ฑฐ
๊ฒ์๊ฒฐ๊ณผ๋ฅผ ์ ๋ ฌ๋ ์์ผ๋ก ์ฃผ์ด์ง ์ซ์๋งํผ๋ง ์กฐํ
CONCAT ๋ฌธ๋ฒ
select concat('string1','string2', ...)
ALIAS ๋ฌธ๋ฒ
select column as alias
from tablename
DISTINCT ๋ฌธ๋ฒ
select distinct column1, column2, ...
from tablename
LIMIT ๋ฌธ๋ฒ
select column1, column2, ...
from tablename
where condition
limit number;
select concat('์ด๋ฆ :',name,' ์ง์
:',job_title) as information
from ๋๋ฉด๋ญํ๋
where name like '___'
limit 3;
select concat('์ด๋ฆ:',a.name,' ๋์ด:',a.age,'(',a.sex,')') as ์ ์์ ๋ณด,
concat(b.season,'-',b.episode,' / ',b.broadcast_date) as ์ถ์ฐ์์ ๋ณด,
a.agency ์์์ฌ์ ๋ณด
from ๋๋ฉด๋ญํ๋ a, ํ๊ณ๊ณ b
where a.name=b.guest;
select distinct season from ํ๊ณ๊ณ
order by season;
select name, age, sex from ๋๋ฉด๋ญํ๋
where sex = 'M'
order by age desc
limit 5;
select concat('ํ๊ณ๊ณ ','์์ฆ',season,' ์ํผ์๋',episode,' ๊ฒ์คํธ ',guest) ํ๊ณ๊ณ _๋ฐฉ์ก์ ๋ณด
from ํ๊ณ๊ณ
order by broadcast_date desc
limit 2;
์ค์ตํ์ธ
![]() | ![]() | ![]() |
|---|
![]() | ![]() |
|---|