Skip to main content
deleted 6 characters in body
Source Link
dfundako
  • 392
  • 2
  • 13

Just use a second table and join them.

create table #images1images1( id int not null ); create table #images2images2( id int not null ); insert into #images1images1 values(1), (2), (3), (4), (6), (8); insert into #images2images2 values (4), (5), (6); SELECT i2.ID FROM #images2images2 i2 LEFT JOIN #images1images1 i1 ON i1.ID = i2.ID WHERE i1.ID IS NULL 

Just use a second table and join them.

create table #images1( id int not null ); create table #images2( id int not null ); insert into #images1 values(1), (2), (3), (4), (6), (8); insert into #images2 values (4), (5), (6); SELECT i2.ID FROM #images2 i2 LEFT JOIN #images1 i1 ON i1.ID = i2.ID WHERE i1.ID IS NULL 

Just use a second table and join them.

create table images1( id int not null ); create table images2( id int not null ); insert into images1 values(1), (2), (3), (4), (6), (8); insert into images2 values (4), (5), (6); SELECT i2.ID FROM images2 i2 LEFT JOIN images1 i1 ON i1.ID = i2.ID WHERE i1.ID IS NULL 
Source Link
dfundako
  • 392
  • 2
  • 13

Just use a second table and join them.

create table #images1( id int not null ); create table #images2( id int not null ); insert into #images1 values(1), (2), (3), (4), (6), (8); insert into #images2 values (4), (5), (6); SELECT i2.ID FROM #images2 i2 LEFT JOIN #images1 i1 ON i1.ID = i2.ID WHERE i1.ID IS NULL