数据库的一些操作

select * from job_for_search where jobkey in (select jobkey from job_for_search group by jobkey having count(jobkey) > 1)  //判断所有根据jobkey重复的元素



DELETE FROM job_for_search  

WHERE id IN (SELECT * 

             FROM (SELECT id FROM job_for_search 

                   GROUP BY jobkey HAVING (COUNT(*) > 1)

                  ) AS A

            );


(去除数据库中重复的数据)

留下您的评论

回复列表:

By王炳宁 on May 24, 2016 | 类别 Java

关于本站