Automation Studio のクエリアクティビティ(Query Activity)などで、NULL の値が抽出されず意図した通りの結果とならない場合があります。
たとえば、参照する対象のデータエクステンション (例: Example Data Extension) 内に以下のようなレコードがある場合で、
samplekey,samplefield 111,aaa 222,bbb 333,<<null>> 444,ddd
以下のように、「samplefield が aaa ではない」レコードを抽出したい場合、
SELECT samplekey,samplefield FROM [ExampleDE] WHERE samplefield <> 'aaa'
クエリを実行した結果は以下のようになります。
samplekey,samplefield 222,bbb 444,ddd
上記の通り、samplefield が NULL のレコード (samplekey: 333 のレコード) は抽出されません。
これは、データベース上において NULL はいかなる値とも比較対象とすることができず、結果的に NULL を持つレコードは無視されることに起因します。
SELECT samplekey,samplefield FROM [ExampleDE] WHERE samplefield <> 'aaa' OR samplefield is NULL
000395400

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.