程序代码:
CREATE CURSOR test (xm c(30)) INSERT INTO test VALUES ("张三、张三、李四") INSERT INTO test VALUES ("刘三、李四、刘三") INSERT INTO test VALUES ("李四江、刘三、李四、刘三") SELECT *, PADR(fun(),30," ") new_xm FROM test FUNCTION fun() ALINES(arr,xm,15,"、") DIMENSION tmp[ALEN(arr)] tmp[1] = arr[1] ret = arr[1] k = 1 FOR i=2 TO ALEN(arr) IF ASCAN(tmp,arr[i],1,-1,-1,15) == 0 k = k + 1 tmp[k] = arr[i] ret = ret + "、" + arr[i] ENDIF ENDFOR RETURN ret ENDFUNC