求助:16组相似的命令,简化成一组命令。
学校代码从2201到2216,一共16所学校,我现在的代码是分别把这16个学校分数线以下的考生删除。这每条命令中,只有学校代码不一样,其他的地方都一样。
16个学校,我复制粘贴了16回,如果是100所学校,我得复制粘贴100回,这个办法太笨了。
感觉应该有更简洁的代码,请各位老师指点。
******************************************************
select zbx from bmddm where xxdm='2201' INTO ARRAY fsx
DELETE from 2201 WHERE zf<fsx
select zbx from bmddm where xxdm='2202' INTO ARRAY fsx
DELETE from 2202 WHERE zf<fsx
select zbx from bmddm where xxdm='2203' INTO ARRAY fsx
DELETE from 2203 WHERE zf<fsx
select zbx from bmddm where xxdm='2204' INTO ARRAY fsx
DELETE from 2204 WHERE zf<fsx
select zbx from bmddm where xxdm='2205' INTO ARRAY fsx
DELETE from 2205 WHERE zf<fsx
select zbx from bmddm where xxdm='2206' INTO ARRAY fsx
DELETE from 2206 WHERE zf<fsx
select zbx from bmddm where xxdm='2207' INTO ARRAY fsx
DELETE from 2207 WHERE zf<fsx
select zbx from bmddm where xxdm='2208' INTO ARRAY fsx
DELETE from 2208 WHERE zf<fsx
select zbx from bmddm where xxdm='2209' INTO ARRAY fsx
DELETE from 2209 WHERE zf<fsx
select zbx from bmddm where xxdm='2210' INTO ARRAY fsx
DELETE from 2210 WHERE zf<fsx
select zbx from bmddm where xxdm='2211' INTO ARRAY fsx
DELETE from 2211 WHERE zf<fsx
select zbx from bmddm where xxdm='2212' INTO ARRAY fsx
DELETE from 2212 WHERE zf<fsx
select zbx from bmddm where xxdm='2213' INTO ARRAY fsx
DELETE from 2213 WHERE zf<fsx
select zbx from bmddm where xxdm='2214' INTO ARRAY fsx
DELETE from 2214 WHERE zf<fsx
select zbx from bmddm where xxdm='2215' INTO ARRAY fsx
DELETE from 2215 WHERE zf<fsx
select zbx from bmddm where xxdm='2216' INTO ARRAY fsx
DELETE from 2216 WHERE zf<fsx
******************************************************
学校代码从2201到2216,一共16所学校,我现在的代码是分别把这16个学校分数线以下的考生删除。
这每条命令中,只有学校代码不一样,其他的地方都一样。
16个学校,我复制粘贴了16回,如果是100所学校,我得复制粘贴100回,这个办法太笨了。
感觉应该有更简洁的代码,请各位老师指点。
[此贴子已经被作者于2019-6-17 16:40编辑过]