Skip to Content
SQL로 시작하는 데이터 분석
book

SQL로 시작하는 데이터 분석

by 캐시 타니무라, 박상근
August 2022
Beginner to intermediate
436 pages
9h 43m
Korean
Hanbit Media, Inc.
Content preview from SQL로 시작하는 데이터 분석
77
2
데이터 준비
nullif(6,6)
위의
nullif
함수를 사용한 코드는 다음
CASE
문과 동일하게 동작합니다.
case when 6 = 7 then 6
when 6 = 6 then null
end
nullif
함수는 새로운 행이 데이터베이스에 추가될 때, 특정 필드의 기본값이 무엇인지 알고
있으며 이 값을
null
로 바꾸고 싶을 때 유용합니다. 예를 들어, 앞서 언급한 기본 날짜 설정 논
쟁을 해결하려면 다음과 같이
nullif
함수를 사용해
1970
-
01
-
01
null
로 변환합니다.
nullif(date,’1970-01-01’)
WARNING
_
WHERE
절을 사용해 데이터를 필터링할 때
null
이 문제의 소지가 될 수 있습니다. 필터링한
결과가
null
인 경우만을 다룰 때는 다음처럼 간단히 해결됩니다.
WHERE my_field is null
하지만
my
_
field
필드가
null
값뿐 아니라 과일 이름 값을 저장한다고 해봅시다. 저장된 값이
apple
아닌 행을 반환받고 싶다면 다음 쿼리를 수행할 겁니다.
WHERE my_field <> ‘apple’
하지만 어떤 데이터베이스에서는
my
_
field
필드에
apple
뿐 아니라
null
값이 저장된 행까지 필터링되
기도 합니다. 이 문제를 해결하려면
SQL
을 작성할 때
OR
연산자를
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

행동 데이터 분석

행동 데이터 분석

플로랑 뷔송
견고한 데이터 엔지니어링

견고한 데이터 엔지니어링

조 라이스, 맷 하우슬리
파이썬으로 살펴보는 아키텍처 패턴

파이썬으로 살펴보는 아키텍처 패턴

오현석, 해리 퍼시벌, 밥 그레고리
실무로 통하는 클린 코드

실무로 통하는 클린 코드

막시밀리아노 콘티에리

Publisher Resources

ISBN: 9791169210089