22,207
社区成员
发帖
与我相关
我的任务
分享
select * from SM_Received_SM_List where pad3 not in (select userappend from mdao_sys_account WHERE userappend IS NOT NULL)
或者直接用not exists == not in and 字段 is not null
--这样你是得不到结果的
declare @t table (col int)
insert into @t
select 1 union all
select 2 union all
select 3 union all
select 4 union all
select null
declare @t1 table (col int)
insert into @t1
select 4 union all
select 5 union all
select 6 union all
select 7 union all
select null
select * from @t1 where col not in (select * from @t)
select *
from SM_Received_SM_List
where ltrim(rtrim(pad3))
not in
(select ltrim(rtrim(userappend)) from mdao_sys_account)