SQL 복습 - 1

Keypoint·2022년 6월 27일
0

SQL 일지

목록 보기
1/4

1. select - 조회

2. where - 조건

select * from point_users
where point > 20000;

3. where 절에서 많이 쓰이는 문법

3-1. and(조건 추가)
3-2. =(같음)
3-3. !=(같지 않음)
3-4. between a and b(a ~ b 사이 범위)
3-5. in(포함)
3-6. like 'a%c'(a로 시작하고 c로 끝나는 문자열)

추가 함수

4. limit 일부 데이터만 보기

select * from orders 
where payment_method = "kakaopay"
limit 5;

5. Distinct 중복 제외

select distinct(payment_method) from orders;

6. Count 숫자 세기

select count(*) from orders

응용 Distinct, Count 같이 써보기

SELECT count(distinct(name)) from users;
profile
QA Engineer

0개의 댓글