sql 重复数据查询
具体代码:
SELECT * FROM Tkx_Invoice WHERE in_invoiceTitle IN (SELECT in_invoiceTitle FROM [dbo].[Tkx_Invoice] GROUP BY in_invoiceTitle HAVING COUNT(in_invoiceTitle)>1); SELECT COUNT(in_invoiceTitle) AS tcount,in_invoiceTitle FROM Tkx_Invoice GROUP BY in_invoiceTitle HAVING COUNT(*)>1 ORDER BY tcount DESC;