JackQu的程序员博客

欢迎来的我Blog.这里记录工作学习的点滴,愿与大家分享。欢迎大家共同交流 。

导航

账单明细表 创建唯一索引


CREATE UNIQUE ASCENDING INDEX I_ACCBILLSITEMS_SRCACTID ON ACCBILLSITEMS (SYSID, SRCACTID, SRCENTITYID, SRCLINENO) 
---------
查询重复记录:
select a.sysid ,a.srcactid , a.srcentityid, a.srclineno  from accbillsitems a,accbillsitems b
 
where a.sysid=b.sysid and a.srcactid=b.srcactid and a.srcentityid=b.srcentityid and a.srclineno=b.srclineno
group by a.sysid ,a.srcactid , a.srcentityid, a.srclineno
having count(a.itemid)>1 

posted on 2008-12-19 15:49  Qcj  阅读(413)  评论(0编辑  收藏  举报