CREATE TABLE #A(ID INT,NAME VARCHAR(10))
INSERT INTO #A VALUES(1,'ABC')
INSERT INTO #A VALUES(2,'XYZ')
INSERT INTO #A VALUES(3,'mnc')
CREATE TABLE #B(ID INT,NAME VARCHAR(10))
INSERT INTO #B VALUES(null,'ABC')
INSERT INTO #B VALUES(2,'XYZ')
INSERT INTO #B VALUES(3,'mnc')
Select * from #A where ID not in (select ID from #B WHERE ID IS NOT NULL)
DROP TABLE #A
DROP TABLE #B