강의

멘토링

커뮤니티

Inflearn Community Q&A

iliili87177705's profile image
iliili87177705

asked

An easy and fun SQL story with Teacher Jangrae

IFNULL function for handling NULL values

null 수강 관련 문의

Written on

·

102

0

image.png

퀴즈 풀고 있는데 강의를 들어도 왜 여기서 오류가 나는지 모르겠어요 ㅜㅜ

sqlmysqloracledbms/rdbmsmssql

Answer 1

0

jangrae님의 프로필 이미지
jangrae
Instructor

안녕하세요?

NULL 값은 IS NULL, IS NOT NULL로 비교하지만, 일반적인 값을 비교할 때는 IS 가 아닌 = 연산자를 사용해야 합니다. 그러므로 다음과 같이 gender = 'F' 형태로 수정해야 합니다.

SELECT emp_name, emp_id, gender, dept_id, hire_date, 
       COALESCE(salary, 0) AS salary
	FROM employee
    WHERE retire_date IS NULL AND gender = 'F';

질문해 주셔서 감사합니다~

iliili87177705's profile image
iliili87177705

asked

Ask a question