MySQL

MySQL- is null : null인 데이터를 가져오는 방법

왕현성 2022. 12. 7. 17:23
728x90

comments 테이블은 위 사진과 같습니다.

 

is null

-- comments 테이블에서 updated_at 컬럼이 null인 데이터를 가져오시오.

select *
from comments
where updated_at is null;

 

is not null

-- comments 테이블에서 updated_at 컬럼이 null이 아닌 데이터를 가져오시오.

select *
from comments
where updated_at is not null;