Oracle 如何查询出一个表中相同的数据

1)
select *
from tab t
where exists (select 1 from tab where id = t.id and (name <> t.name or age <> t.age)

2)
select *
from tab
where id in (select id from tab group by id having count(*) > 1)

猜你喜欢

转载自maizi2011.iteye.com/blog/1620405