select xm, count(xm) from table group by xm having count(xm)>1
Select * From tablename Where xm + Convert(Varchar(10), csrq, 121) In (Select xm + Convert(Varchar(10), csrq, 121) From tablename Group by xm, Convert(Varchar(10), csrq, 121) Having Count(*) >= 2)
select * from yourtable order by xm,csrq
select xm,csrq,count(*) as num from yourtable group by xm,csrq
select t1.* from tab t1, (select xm,convert(varchar(10),csrq,120) as csrq from tab group by xm,convert(varchar(10),csrq,120) having count(*)>1) t2 where t1.xm=t2.xm and convert(varchar(10),t1.csrq,120) =t2.csrq
select * from info t1 join info t2 on t1.xm=t2.xm and t1.csrq=t2.csrq
group by xm
having count(xm)>1
group by xm,csrq
(select xm,convert(varchar(10),csrq,120) as csrq from tab group by xm,convert(varchar(10),csrq,120) having count(*)>1) t2
where t1.xm=t2.xm and convert(varchar(10),t1.csrq,120) =t2.csrq