这个简单啊,先 Index on 工号 + 不良原因 to 自己取一个临时索引名
再汇总: Total to 自己取一个汇总文件名 on 工号 + 不良原因
最后,打开那个汇总文件,看看是不是你想要的东西?
程序代码:set safety off
create cursor tt (gh c(2),cwyy c(10),d01 c(10),d02 c(10),d03 c(10))
insert into tt values ("01","铜丝外露","","","检讨")
insert into tt values ("01","铜丝外露","","教育","")
insert into tt values ("01","铜丝外露","教育","","")
insert into tt values ("01","芯线未露","教育","","")
insert into tt values ("02","外皮远咬","","","教育")
insert into tt values ("03","铜丝外露","","教育","")
insert into tt values ("03","外皮远咬","","","教育")
select * from tt where .f. union all select distinct gh,cwyy,space(10),space(10),space(10) from tt into table tj
select tj
index on gh+cwyy tag xx
select tt
set relation to gh+cwyy into tj
scan
replace d01 with d01-tt.d01,d02 with d02-tt.d02,d03 with d03-tt.d03 in tj
endscan
select tj
browse
close databases
erase tj.dbf
erase xx.cdx[此贴子已经被作者于2016-11-8 14:32编辑过]
