MySQL

[MySQL] null인 데이터 가져오기 is null

건휘맨 2024. 5. 14. 15:07

is null : null 인 데이터를 가져온다.

-- null 데이터 가져오는 방법
-- 재고가 null 인 데이터를 가져오시오.

select *
from books
where stock_quantity is null;

 

-- 재고가 null 이 아닌 데이터만 가져오시오.

select *
from books
where stock_quantity is not null;

'MySQL' 카테고리의 다른 글

[MySQL] if() 함수  (0) 2024.05.14
[MySQL] case  (0) 2024.05.14
[MySQL] Sub Query  (0) 2024.05.14
[MySQL] 데이터 그룹화하여 처리 group by, having  (0) 2024.05.14
[MySQL] 데이터 집계 함수 count, sum, avg, max, min  (0) 2024.05.14