sorry try this
select A.id, A.col2, A.col3
from yourtable A
where
(A.col2 is not null and A.col3 is not null) or
Exists (select B.Col2 from yourtable b where B.Id = A.ID and B.Col2= A.col2 group by B.Col2 having count(*) =1 )
or
Exists
(select c.Col3 from yourtable c where c.Id = A.ID and C.Col3= A.Col3 group by c.Col3 having count(*) =1 )
Main Topics
Browse All Topics





by: imran_fastPosted on 2007-08-21 at 04:39:32ID: 19736829
select A.id, A.col2, A.col3
from yourtable A
where
(A.col2 is not null and A.col3 is not null) or
A.col2 in (select B.Col2 from yourtable b where B.Id = A.ID group by B.Col2 having count(*) =1 )
or
A.col3 in (select c.Col2 from yourtable c where c.Id = A.ID group by c.Col2 having count(*) =1 )