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 
相关文章
相关标签/搜索