[SQL문제풀기] NULL 처리하기(IS NULL)

241211
이나겸's avatar
Dec 11, 2024
[SQL문제풀기] NULL 처리하기(IS NULL)
Contents
Q.풀이

Q.

notion image
 
 

풀이

  • if null(컬럼명, ‘대체값’)
    • 해당 컬럼의 값이 null일때 다른 값(대체 값)으로 출력할 수 있음
select animal_type, ifnull(name, 'No name') as name, sex_upon_intake from animal_ins order by animal_id;
Share article

Nakyeom's Study