同字段的字符合并问题
请教如图,希望相同工号相同不良原因的处理方式按日期显示在一条记录中,而不是每天显示一条。
数值型数据可以用sum()合并,字符型有类似的合并函数吗?如果没有该怎么处理呢?谢谢!
附件为源表数据,不良原因用code表示了
[此贴子已经被作者于2016-11-8 14:59编辑过]
2016-11-08 10:14
2016-11-08 10:52
2016-11-08 11:17
2016-11-08 12:24
2016-11-08 13:10
2016-11-08 13:46
2016-11-08 13:58
程序代码: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编辑过]

2016-11-08 14:18
2016-11-08 14:31
2016-11-08 15:00