mysql查找一个表中字段相同的数据


查找 education_student_tmp_from_crpn 表中 stu_no 相同的数据 

SELECT
* FROM `education_student_tmp_from_crp` a WHERE (a.stu_no) IN ( SELECT stu_no FROM `education_student_tmp_from_crp` GROUP BY stu_no HAVING COUNT(*) > 1 )
查找 aiops_cmdb_host 表中 alias_name 相同的数据 


SELECT
* FROM `aiops_cmdb_host` a WHERE (a.alias_name) IN ( SELECT alias_name FROM `aiops_cmdb_host` GROUP BY alias_name HAVING COUNT(*) > 1 ) ORDER BY a.alias_name

 

posted @ 2020-12-23 14:18  胖头陀春天  阅读(1368)  评论(0编辑  收藏  举报