我希望有人发现了这个!
我注意到在sas hadoop(显式sql pass-through)中使用“not in”where条件时,它将删除与之相关的字段(reason字段)中的空白。
如果使用'standard'proc sql,它只删除声明的内容,而不删除空白。
有办法让我保留空白吗?
示例代码:
Create Table TEST_02 As
Select
a.*
,b.Info
,b.Info2
From TEST_01 a
Left Join TEST_03 b
ON a.SERVICE = b.SERVICE
Where a.REASON Not In ('REASON1', 'REASON2', 'REASON3')
And a.ACTIVITY Not In ('ACTIVITY1','ACTIVITY2')
And a.e_date >= >= '2018-01-01'
最佳答案:
试试这个变体
( a.REASON Not In ('REASON1', 'REASON2', 'REASON3') or a.REASON IS NULL )
and
( a.ACTIVITY Not In ('ACTIVITY1','ACTIVITY2') or a.ACTIVITY IS NULL )