Monday, February 27, 2012

except acting like a not in or not exists

with test (id,name)
as
(
select 1 id,'herby' name
union select 2 id,'john' name
)
select * from test
where id in
(
select id from test
except
 select 1 id
)

No comments:

Post a Comment