| 网站首页 | 业界新闻 | 小组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛

已结贴   问题点数：20  回复次数：10

6-10字母是数学老师各项得分
11-15字母是外语老师得分

得分:0

得分:0

得分:2
Select *,Len(Chrtran(zifu," ",""))-Len(Chrtran(zifu,"A ","")) As A,;
LEN(Chrtran(zifu," ",""))-Len(Chrtran(zifu,"B ","")) As B,;
LEN(Chrtran(zifu," ",""))-Len(Chrtran(zifu,"C ","")) As C,;
LEN(Chrtran(zifu," ",""))-Len(Chrtran(zifu,"D ","")) As D;
FROM 表
得分:2
CLEAR
fz='a10b09c08d07'
ls='语文数学外语'

FOR i=1 TO 15 STEP 5
vz = SUBSTR(zhifu,i,5)
jg = 0
FOR j=1 TO 12 STEP 3
zz  = SUBSTR(fz,j,1)
zzz = VAL(SUBSTR(fz,j+1,2))
jg = jg +(LEN(vz)-len(CHRTRAN(vz,zz,'')))*zzz
ENDFOR
?SUBSTR(ls,((i-1)/5)*4+1,4)+":"+STR(jg,4)
ENDFOR
得分:4
Select Cast(banji as N(10)) as banji, zifu from 源表 into cursor temp
Copy To temp.txt sdf
Use in Select('源表')
Use in Select('temp')

*-- 拆分成1+15个字段
cFlds = 'banji N(10)'
For i = 1 to 15
cFlds = cFlds + Textmerge(',f<<i>> C(1)')
EndFor
Create Cursor temp (&cFlds)
Append From temp.txt sdf
Erase temp.txt

cSql = ''
For i = 1 to 3
cName = ICase(i==1, '语文', i==2, '数学', '外语') + '老师'
For j = 1 to 5
If i == 1 and j == 1
c1 = ''
Else
c1 = ' union all'
EndIf
Text to c1 Noshow textmerge pretext 1+2+4+8
<<c1>> select '<<cName>>' 老师,f<<j+(i-1)*5>> 分数,count(*) 个数 from temp group by 老师,分数
EndText
cSql = cSql + c1
EndFor
EndFor
Text to cSql Noshow textmerge pretext 1+2+4+8
Select 老师,分数,Sum(个数) 个数 from (<<cSql>>) a group by 老师,分数
EndText
&cSql
得分:8

```CLOSE DATABASES ALL
cZdm = "Kh C(9)"
FOR nCnt = 1 TO 15
cZdm = cZdm + ", " + "Zd" + PADL(nCnt, 2, "0") + " N(4)"
ENDFOR
CREATE CURSOR tjb (&cZdm)
USE 全体 IN 0 ALIAS qt
SELECT qt
SCAN
LOCAL aSj[16]
aSj = 0
aSj[1] = qt.Kh
FOR nCnt = 2 TO 16
DO CASE
CASE BETWEEN(nCnt, 2, 15)
cStr = SUBSTR(da1, (nCnt-2) * 5 + 1 ,5)
OTHERWISE
cStr = SUBSTR(da1, 71 ,10)
ENDCASE
FOR ii = 1 TO LEN(cStr)
cStr1 = SUBSTR(cStr, ii, 1)
aSj[nCnt] = aSj[nCnt] + ICASE(cStr1 == "A", 10,cStr1 == "B", 9,cStr1 == "C", 8,cStr1 == "D", 7, 0)
ENDFOR
ENDFOR
INSERT INTO tjb FROM ARRAY aSj
ENDSCAN
SELECT tjb
BROWSE ```

[此贴子已经被作者于2019-1-23 23:33编辑过]

得分:1

得分:3
CLOSE DATABASES

SELECT 0
USE pjtj alia kg
SCAN
_yw=SUBSTR(kg.zifu,1,5)
_sx=SUBSTR(kg.zifu,6,5)
_yy=SUBSTR(kg.zifu,11,5)
REPLACE yw with OCCURS('A',_yw)*10+OCCURS('B',_yw)*9+OCCURS('C',_yw)*8+OCCURS('D',_yw)*7
REPLACE sx with OCCURS('A',_sx)*10+OCCURS('B',_sx)*9+OCCURS('C',_sx)*8+OCCURS('D',_sx)*7
REPLACE yy with OCCURS('A',_yy)*10+OCCURS('B',_yy)*9+OCCURS('C',_yy)*8+OCCURS('D',_yy)*7
SELECT kg
ENDSCAN

得分:0

• 11
• 1/2页
• 1
• 2