|
create table A(ID int, TITLE nvarchar(10))
insert A select 1,'Nokia'
union all select 2,'Motorola'
union all select 3,'Siemens'
create table B(PRODUCT_ID int, TITLE varchar(10), brand ID int)
insert B select 1, '3310', 1
--1
select * from A
where ID not in
(select distinct brand ID from B)
--2
select * from A as A
where not exists(select 1 from B where brand ID=A.ID) |
|