Hi @Lylyy
Syntax: test_expression [ NOT ] IN ( subquery | expression [ ,...n ] )
Any null values returned by subquery or expression that are compared to test_expression using IN or NOT IN return UNKNOWN.
Please refer to this doc for more details: IN (Transact-SQL).
To return null value, you may try this query:
select * from @tbl
where isnull(val,'') not in ('aaa','bbb')
Best regards,
Cosmog Hong