November 14, 2009 at 12:33 am
HI
DECLARE @t Table (t int)
insert into @t values(1)
insert into @t values(2)
insert into @t values(3)
insert into @t values(4)
insert into @t values(5)
insert into @t values(6)
DECLARE @t1 Table (r int,c int )
insert into @t1 values(2,2)
insert into @t1 values(3,4)
insert into @t1 values(6,6)
SELECT * FROM @t
SELECT * FROM @t1
i need 1,5 as output which is not in second table
Thanks
Parthi
Thanks
Parthi
November 14, 2009 at 1:16 am
select t from
(select t,r,c
from @t left join @t1
on t = r
or t = c) as x
where r is null
and c is null
November 14, 2009 at 7:37 am
SELECT t
FROM @t
WHERE NOT EXISTS
(
SELECT *
FROM @t1
WHERE t IN (r,c)
);
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply