Database/MySQL (DBeaver)

[DBeaver] MySQL - 값이 null인 데이터 조회하기

juunghee 2025. 1. 12. 23:38
값이 null인 데이터 조회하기

 

 

 

값이 null인 데이터를 조회할 때는

: is null

null이 아닌 데이터를 조회할 때는

: is not null

을 사용해준다.

 

사용법

select *
from 테이블명
where 컬럼 is null;

 

 

 

재고가 null인 데이터를 조회

select *
from books
where stock_quantity is null;

 

재고가 null이 아닌 데이터를 조회

select *
from books
where stock_quantity is not null;

 

 

 

 

 

 

 

 

 

 

 

home