重复字符保留问题
如表:create cursor b1 (m c(5),m1 c(3))
insert into b1 values ("1002","")
insert into b1 values ("12123","")
insert into b1 values ("123","")
insert into b1 values ("01110","")
insert into b1 values ("22201","")
insert into b1 values ("02002","")
insert into b1 values ("1002","")
insert into b1 values ("12123","")
insert into b1 values ("123","")
insert into b1 values ("01110","")
insert into b1 values ("22201","")
insert into b1 values ("02002","")
从左查起,第1个字符在m中相同个数>1,则m1中有这个相同字符1个;又从第2个字符查起,在第2个及后面的字符中相同个数>1,则m1中又增加这个字符.....
运行结果如下:
程序代码:
create cursor b1 (m c(5),m1 c(3)) insert into b1 values ("1002","0") insert into b1 values ("12123","12") insert into b1 values ("123","") insert into b1 values ("01110","011") insert into b1 values ("22201","22") insert into b1 values ("02002","020")
谢谢!
[此贴子已经被作者于2020-10-12 18:38编辑过]