[SQL]where 문 활용하기(AND, OR, BETWEEN, IN, LIKE)

건너별·2021년 11월 17일
0

SQL

목록 보기
2/14

where문을 어떻게 활용할 수 있을지 알아봅시다.

table 모양 확인

1. AND(OR)

select CountryCode, District
from city
where countrycode='KOR' AND District='Seoul';

2. BETWEEN(수치 값)

select * from city where population between 100000 and 300000;

3. IN

select * from city
where name in ('Kabul', 'Seoul', 'Tokyo');

4. LIKE

# New로시작하는 모든 값들 출력
select * from city where Name LIKE 'New%';

profile
romantic ai developer

0개의 댓글