select A.* from tb_mend_enrol A, (select A.Typeid, A.address from tb_mend_enrol A
select A.* from tb_mend_enrol A,
(select A.Typeid, A.address from tb_mend_enrol A
group by A.Typeid, A.address
having count(A.Typeid) >= 2 and count(A.address) >= 2 ) B
where A.Typeid = B.Typeid and A.address = B.address and a.reporter="测试"
and A.reptime >= to_date("2018-08-01 00:00:00","YYYY-MM-DD HH24:MI:SS")
order by A.Address, A.reptime
方法二:
select A.* from tb_mend_enrol A
where (select count(*) from tb_mend_enrol A1
where A1.Typeid = A.Typeid and A1.address=A.address)>1
and a.reporter="测试"
and A.reptime >= to_date("2018-08-01 00:00:00","YYYY-MM-DD HH24:MI:SS"
order by A.Address
--结束END--
本文标题: oracle 查询两个字段值相同的记录
本文链接: https://www.lsjlt.com/news/2655.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-09
2024-05-09
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0