2,750
社区成员
发帖
与我相关
我的任务
分享Create Cursor 表X (Ksh C(4))
Insert Into 表X Values ("0601")
Insert Into 表X Values ("0603")
Insert Into 表X Values ("0612")
Insert Into 表X Values ("0613")
Insert Into 表X Values ("0614")
Create Cursor 表Y (Ksh C(7),Cj N(3))
Insert Into 表Y Values ("0601001",100)
Insert Into 表Y Values ("0601023",50)
Insert Into 表Y Values ("0603002",40)
Insert Into 表Y Values ("0612123",80)
Insert Into 表Y Values ("0613222",55)
Insert Into 表Y Values ("0614552",33)
Select A.Ksh,B.成绩 From 表X A Inner Join (Select Left(Ksh,4) Ksh,Sum(Cj) 成绩 From 表Y Group By 1) B On A.Ksh==B.Ksh Into Cursor 表Z