程序代码:
CREATE CURSOR tt (xm c(10), j1 c(2), j2 c(2), j3 c(2)) INSERT INTO tt VALUES ("姓名1","早","中","晚") INSERT INTO tt VALUES ("姓名2","中","晚","早") INSERT INTO tt VALUES ("姓名3","早","晚","早") INSERT INTO tt VALUES ("姓名4","晚","中","晚") SELECT *, fun("早") 早班, fun("中") 中班, fun("晚") 晚班 FROM tt FUNCTION fun(cj) LOCAL i,ret ret = 0 FOR i=2 TO FCOUNT() IF EVALUATE(FIELD(i))==cj ret = ret + 1 ENDIF ENDFOR RETURN ret ENDFUNC