程序代码:
Create Cursor Temp (班级 C(4), 班级平均数 n(4), reason n(4),调整后数据 n(6,2)) Insert Into Temp Values ("1班", 70, 0 ,0) Insert Into Temp Values ("1班", 70, 0 ,0) Insert Into Temp Values ("1班", 70, 1 ,0) Insert Into Temp Values ("1班", 70, 1 ,0) Insert Into Temp Values ("1班", 70, 2 ,0) Insert Into Temp Values ("1班", 70, 2 ,0) Insert Into Temp Values ("1班", 70, 3 ,0) Insert Into Temp Values ("1班", 70, 3 ,0) Insert Into Temp Values ("1班", 70, 4 ,0) Insert Into Temp Values ("1班", 70, 5 ,0) Insert Into Temp Values ("2班", 85, 0 ,0) Insert Into Temp Values ("2班", 85, 0 ,0) Insert Into Temp Values ("2班", 85, 1 ,0) Insert Into Temp Values ("2班", 85, 1 ,0) Insert Into Temp Values ("2班", 85, 0 ,0) Insert Into Temp Values ("2班", 85, 0 ,0) Insert Into Temp Values ("2班", 85, 0 ,0) select 班级,班级平均数*count(*) /sum(iif(reason=1,0,1)) nn from temp group by 班级,班级平均数 into cursor tt scan update temp set 调整后数据=tt.nn where temp.班级=tt.班级 and reason!=1 endscan select temp browse
VFP6 CODE
坚守VFP最后的阵地