sql查找重复值参考版
SELECT distinct d.YZMXBM,b.DMXMC,c.JC, to_char(d.SJ,'yyyy-MM-dd') as SJ
FROM TB_DIC_Detail_Item b, TB_DIC_Hospital c,
(select YZMXBM,CFXDYYDM,MAX(CFXDSJ) SJ
FROM CS_YYXX
WHERE HZWYH='9999' AND YZMXBM='1.1.1.1.3.10009'
GROUP BY YZMXBM,CFXDYYDM) d
WHERE d.YZMXBM=b.DMXDMZ and d.CFXDYYDM=c.DMXDMZ