个人认为单纯的使用SQL语句来实现是非常困难的。可以使用据体的某种语言(c,c#,java,.net)等来辅助实现此种功能。
查询C字段有重复的记录吗?
如果是小表可以这样写:
select a from tabname
where c in
(select c from tabname group by c having count(1) >1 )
大表(需建c列索引):
select a from tabname a
where exists (select c from tabname b where b.c=a.c group by c having count(1) >1 )
SELECT * FROM tab WHERE C in (
SELECT C
FROM tab
GROUP BY C
HAVING COUNT(A) > 1 )
select A from 表
group by A
having count(C)>=2
select A FROM 表
where C in (
SELECT C FROM 表
group by C
having count(C)>1)