以下是引用y12692189在2023-4-3 09:32:37的发言:
要是找不重复的数据呢?
Create Table 表A (idNumber Char(10))
Insert Into 表A Values ('01')
Insert Into 表A Values ('02')
Insert Into 表A Values ('03')
Insert Into 表A Values ('04')
Insert Into 表A Values ('05')
Create Table 表B (idNumber Char(10))
Insert Into 表B Values ('02')
Insert Into 表B Values ('04')
Insert Into 表B Values ('06')
Insert Into 表B Values ('08')
Go
Select IsNull(a.idNumber, b.IdNumber)
From 表A a
Full Join 表B b On a.idNumber = b.IdNumber
Where a.idNumber Is Null Or b.idNumber Is Null