大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说oracle 查询两个字段值相同的记录,希望您对编程的造诣更进一步.
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
方法二:
代码100分
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
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/10754.html