SQL 기초 강의

2022. 1. 5. 20:51개발일지

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

보면 기부니가 조크든요

같지 않다 구문

select * from orders
where course_title != "같지않음";

 

범위 지정하여 조건 걸기

select * from orders
where created_at between "2020-07-13" and "2020-07-15";

 

포함 조건 걸기

select * from checkins 
where week in (1, 3);

 

패턴 (문자열 규칙) 조건 걸기

select * from users 
where email like '%daum.net';

일부 데이터만 가지고 오기

limit

중복값 제거하기

distinct

select distinct(payment_method) from orders

 

몇개인지 숫자 세기

select count(*) from orders

중복값을 제거하고 몇개인지 숫자 세기

select distinct(name) from users 중복을 제거한 값

중복을 제거한 수 세기

select count(distinct(name)) from users

 

'개발일지' 카테고리의 다른 글

group by, order by alias 사용해보기  (0) 2022.01.11
부트스트랩 기본 인덱스  (0) 2022.01.06