中自网

当前位置:首页>>知道首页>>RTU>>正文

如何cimplicity cimview中执行复杂sql语句

悬赏分:0 问题已关闭 提问者: 匿名


各位高手,小第刚接触cimplicity,公司需要使用6.0 现在我有个这样的cimview:左边一个OWC10.Spreadsheet.10的插件,右边几个按钮,现在可以实现查询数据库已有的表格,使用的是这样的语句

Sub sql()
Dim a() As Variant
l& = SQLRequest("dsn=sql;uid=sa;pwd=sa","select timestamp from buguding where str1_vol_val40 = 2.27",a,,3,True)
For x = 0 To Ubound(a)
For y = 0 To l - 1
cimoleobj.worksheets(1).cells(x+1,y+1).value=a(x,y)
Next y
Next x
End Sub

这个语句编写在OWC10.Spreadsheet.10的插件里,通过点击按钮调用,现在我有这样一个sql语句,想通过点击一个按钮后在OWC10.Spreadsheet.10的插件里得到,应该怎么写呢?

declare @col int
declare @n int --行号
declare @a varchar(400)
declare @getold real --得到被比较值
declare @getnew real
declare @id varchar(4000)

select identity(int,1,1) as number,* into buguding_s from buguding order by timestamp asc --为buguding增加一列行号
select min(number) as number,min(timestamp) as timestamp,str1_ohmic_value_val0,str1_ohmic_value_val1,str1_ohmic_value_val2,str1_ohmic_value_val3,str1_ohmic_value_val4,str1_ohmic_value_val5,str1_ohmic_value_val6,str1_ohmic_value_val7,str1_ohmic_value_val8,str1_ohmic_value_val9,str1_ohmic_value_val10,str1_ohmic_value_val11,str1_ohmic_value_val12,str1_ohmic_value_val13,str1_ohmic_value_val14,str1_ohmic_value_val15,str1_ohmic_value_val16,str1_ohmic_value_val17,str1_ohmic_value_val18,str1_ohmic_value_val19,str1_ohmic_value_val20,str1_ohmic_value_val21,str1_ohmic_value_val22,str1_ohmic_value_val23,str1_ohmic_value_val24,str1_ohmic_value_val25,str1_ohmic_value_val26,str1_ohmic_value_val27,str1_ohmic_value_val28,str1_ohmic_value_val29,str1_ohmic_value_val30,str1_ohmic_value_val31,str1_ohmic_value_val32,str1_ohmic_value_val33,str1_ohmic_value_val34,str1_ohmic_value_val35,str1_ohmic_value_val36,str1_ohmic_value_val37,str1_ohmic_value_val38,str1_ohmic_value_val39,str1_ohmic_value_val40,str1_ohmic_value_val41,str1_ohmic_value_val42,str1_ohmic_value_val43,str1_ohmic_value_val44,str1_ohmic_value_val45,str1_ohmic_value_val46,str1_ohmic_value_val47,str1_ohmic_value_val48,str1_ohmic_value_val49,str1_ohmic_value_val50,str1_ohmic_value_val51,str1_ohmic_value_val52,str1_ohmic_value_val53,str1_ohmic_value_val54,str1_ohmic_value_val55,str1_ohmic_value_val56,str1_ohmic_value_val57,str1_ohmic_value_val58,str1_ohmic_value_val59,str1_ohmic_value_val60,str1_ohmic_value_val61,str1_ohmic_value_val62,str1_ohmic_value_val63,str1_ohmic_value_val64,str1_ohmic_value_val65,str1_ohmic_value_val66,str1_ohmic_value_val67,str1_ohmic_value_val68,str1_ohmic_value_val69,str1_ohmic_value_val70,str1_ohmic_value_val71,str1_ohmic_value_val72,str1_ohmic_value_val73,str1_ohmic_value_val74,str1_ohmic_value_val75,str1_ohmic_value_val76,str1_ohmic_value_val77,str1_ohmic_value_val78,str1_ohmic_value_val79,str1_ohmic_value_val80,str1_ohmic_value_val81,str1_ohmic_value_val82,str1_ohmic_value_val83,str1_ohmic_value_val84,str1_ohmic_value_val85,str1_ohmic_value_val86,str1_ohmic_value_val87,str1_ohmic_value_val88,str1_ohmic_value_val89,str1_ohmic_value_val90,str1_ohmic_value_val91,str1_ohmic_value_val92,str1_ohmic_value_val93,str1_ohmic_value_val94,str1_ohmic_value_val95,str1_ohmic_value_val96,str1_ohmic_value_val97,str1_ohmic_value_val98,str1_ohmic_value_val99,str1_ohmic_value_val100,str1_ohmic_value_val101,str1_ohmic_value_val102,str1_ohmic_value_val103,str1_vol_val0,str1_vol_val1,str1_vol_val2,str1_vol_val3,str1_vol_val4,str1_vol_val5,str1_vol_val6,str1_vol_val7,str1_vol_val8,str1_vol_val9,str1_vol_val10,str1_vol_val11,str1_vol_val12,str1_vol_val13,str1_vol_val14,str1_vol_val15,str1_vol_val16,str1_vol_val17,str1_vol_val18,str1_vol_val19,str1_vol_val20,str1_vol_val21,str1_vol_val22,str1_vol_val23,str1_vol_val24,str1_vol_val25,str1_vol_val26,str1_vol_val27,str1_vol_val28,str1_vol_val29,str1_vol_val30,str1_vol_val31,str1_vol_val32,str1_vol_val33,str1_vol_val34,str1_vol_val35,str1_vol_val36,str1_vol_val37,str1_vol_val38,str1_vol_val39,str1_vol_val40,str1_vol_val41,str1_vol_val42,str1_vol_val43,str1_vol_val44,str1_vol_val45,str1_vol_val46,str1_vol_val47,str1_vol_val48,str1_vol_val49,str1_vol_val50,str1_vol_val51,str1_vol_val52,str1_vol_val53,str1_vol_val54,str1_vol_val55,str1_vol_val56,str1_vol_val57,str1_vol_val58,str1_vol_val59,str1_vol_val60,str1_vol_val61,str1_vol_val62,str1_vol_val63,str1_vol_val64,str1_vol_val65,str1_vol_val66,str1_vol_val67,str1_vol_val68,str1_vol_val69,str1_vol_val70,str1_vol_val71,str1_vol_val72,str1_vol_val73,str1_vol_val74,str1_vol_val75,str1_vol_val76,str1_vol_val77,str1_vol_val78,str1_vol_val79,str1_vol_val80,str1_vol_val81,str1_vol_val82,str1_vol_val83,str1_vol_val84,str1_vol_val85,str1_vol_val86,str1_vol_val87,str1_vol_val88,str1_vol_val89,str1_vol_val90,str1_vol_val91,str1_vol_val92,str1_vol_val93,str1_vol_val94,str1_vol_val95,str1_vol_val96,str1_vol_val97,str1_vol_val98,str1_vol_val99,str1_vol_val100,str1_vol_val101,str1_vol_val102,str1_vol_val103,str2_ohmic_value_val0,str2_ohmic_value_val1,str2_ohmic_value_val2,str2_ohmic_value_val3,str2_ohmic_value_val4,str2_ohmic_value_val5,str2_ohmic_value_val6,str2_ohmic_value_val7,str2_ohmic_value_val8,str2_ohmic_value_val9,str2_ohmic_value_val10,str2_ohmic_value_val11,str2_ohmic_value_val12,str2_ohmic_value_val13,str2_ohmic_value_val14,str2_ohmic_value_val15,str2_ohmic_value_val16,str2_ohmic_value_val17,str2_ohmic_value_val18,str2_ohmic_value_val19,str2_ohmic_value_val20,str2_ohmic_value_val21,str2_ohmic_value_val22,str2_ohmic_value_val23,str2_ohmic_value_val24,str2_ohmic_value_val25,str2_ohmic_value_val26,str2_ohmic_value_val27,str2_ohmic_value_val28,str2_ohmic_value_val29,str2_ohmic_value_val30,str2_ohmic_value_val31,str2_ohmic_value_val32,str2_ohmic_value_val33,str2_ohmic_value_val34,str2_ohmic_value_val35,str2_ohmic_value_val36,str2_ohmic_value_val37,str2_ohmic_value_val38,str2_ohmic_value_val39,str2_ohmic_value_val40,str2_ohmic_value_val41,str2_ohmic_value_val42,str2_ohmic_value_val43,str2_ohmic_value_val44,str2_ohmic_value_val45,str2_ohmic_value_val46,str2_ohmic_value_val47,str2_ohmic_value_val48,str2_ohmic_value_val49,str2_ohmic_value_val50,str2_ohmic_value_val51,str2_ohmic_value_val52,str2_ohmic_value_val53,str2_ohmic_value_val54,str2_ohmic_value_val55,str2_ohmic_value_val56,str2_ohmic_value_val57,str2_ohmic_value_val58,str2_ohmic_value_val59,str2_ohmic_value_val60,str2_ohmic_value_val61,str2_ohmic_value_val62,str2_ohmic_value_val63,str2_ohmic_value_val64,str2_ohmic_value_val65,str2_ohmic_value_val66,str2_ohmic_value_val67,str2_ohmic_value_val68,str2_ohmic_value_val69,str2_ohmic_value_val70,str2_ohmic_value_val71,str2_ohmic_value_val72,str2_ohmic_value_val73,str2_ohmic_value_val74,str2_ohmic_value_val75,str2_ohmic_value_val76,str2_ohmic_value_val77,str2_ohmic_value_val78,str2_ohmic_value_val79,str2_ohmic_value_val80,str2_ohmic_value_val81,str2_ohmic_value_val82,str2_ohmic_value_val83,str2_ohmic_value_val84,str2_ohmic_value_val85,str2_ohmic_value_val86,str2_ohmic_value_val87,str2_ohmic_value_val88,str2_ohmic_value_val89,str2_ohmic_value_val90,str2_ohmic_value_val91,str2_ohmic_value_val92,str2_ohmic_value_val93,str2_ohmic_value_val94,str2_ohmic_value_val95,str2_ohmic_value_val96,str2_ohmic_value_val97,str2_ohmic_value_val98,str2_ohmic_value_val99,str2_ohmic_value_val100,str2_ohmic_value_val101,str2_ohmic_value_val102,str2_ohmic_value_val103,str2_vol_val0,str2_vol_val1,str2_vol_val2,str2_vol_val3,str2_vol_val4,str2_vol_val5,str2_vol_val6,str2_vol_val7,str2_vol_val8,str2_vol_val9,str2_vol_val10,str2_vol_val11,str2_vol_val12,str2_vol_val13,str2_vol_val14,str2_vol_val15,str2_vol_val16,str2_vol_val17,str2_vol_val18,str2_vol_val19,str2_vol_val20,str2_vol_val21,str2_vol_val22,str2_vol_val23,str2_vol_val24,str2_vol_val25,str2_vol_val26,str2_vol_val27,str2_vol_val28,str2_vol_val29,str2_vol_val30,str2_vol_val31,str2_vol_val32,str2_vol_val33,str2_vol_val34,str2_vol_val35,str2_vol_val36,str2_vol_val37,str2_vol_val38,str2_vol_val39,str2_vol_val40,str2_vol_val41,str2_vol_val42,str2_vol_val43,str2_vol_val44,str2_vol_val45,str2_vol_val46,str2_vol_val47,str2_vol_val48,str2_vol_val49,str2_vol_val50,str2_vol_val51,str2_vol_val52,str2_vol_val53,str2_vol_val54,str2_vol_val55,str2_vol_val56,str2_vol_val57,str2_vol_val58,str2_vol_val59,str2_vol_val60,str2_vol_val61,str2_vol_val62,str2_vol_val63,str2_vol_val64,str2_vol_val65,str2_vol_val66,str2_vol_val67,str2_vol_val68,str2_vol_val69,str2_vol_val70,str2_vol_val71,str2_vol_val72,str2_vol_val73,str2_vol_val74,str2_vol_val75,str2_vol_val76,str2_vol_val77,str2_vol_val78,str2_vol_val79,str2_vol_val80,str2_vol_val81,str2_vol_val82,str2_vol_val83,str2_vol_val84,str2_vol_val85,str2_vol_val86,str2_vol_val87,str2_vol_val88,str2_vol_val89,str2_vol_val90,str2_vol_val91,str2_vol_val92,str2_vol_val93,str2_vol_val94,str2_vol_val95,str2_vol_val96,str2_vol_val97,str2_vol_val98,str2_vol_val99,str2_vol_val100,str2_vol_val101,str2_vol_val102,str2_vol_val103 into buguding_temp from buguding_s where str1_ohmic_value_val0 is not null group by str1_ohmic_value_val0,str1_ohmic_value_val1,str1_ohmic_value_val2,str1_ohmic_value_val3,str1_ohmic_value_val4,str1_ohmic_value_val5,str1_ohmic_value_val6,str1_ohmic_value_val7,str1_ohmic_value_val8,str1_ohmic_value_val9,str1_ohmic_value_val10,str1_ohmic_value_val11,str1_ohmic_value_val12,str1_ohmic_value_val13,str1_ohmic_value_val14,str1_ohmic_value_val15,str1_ohmic_value_val16,str1_ohmic_value_val17,str1_ohmic_value_val18,str1_ohmic_value_val19,str1_ohmic_value_val20,str1_ohmic_value_val21,str1_ohmic_value_val22,str1_ohmic_value_val23,str1_ohmic_value_val24,str1_ohmic_value_val25,str1_ohmic_value_val26,str1_ohmic_value_val27,str1_ohmic_value_val28,str1_ohmic_value_val29,str1_ohmic_value_val30,str1_ohmic_value_val31,str1_ohmic_value_val32,str1_ohmic_value_val33,str1_ohmic_value_val34,str1_ohmic_value_val35,str1_ohmic_value_val36,str1_ohmic_value_val37,str1_ohmic_value_val38,str1_ohmic_value_val39,str1_ohmic_value_val40,str1_ohmic_value_val41,str1_ohmic_value_val42,str1_ohmic_value_val43,str1_ohmic_value_val44,str1_ohmic_value_val45,str1_ohmic_value_val46,str1_ohmic_value_val47,str1_ohmic_value_val48,str1_ohmic_value_val49,str1_ohmic_value_val50,str1_ohmic_value_val51,str1_ohmic_value_val52,str1_ohmic_value_val53,str1_ohmic_value_val54,str1_ohmic_value_val55,str1_ohmic_value_val56,str1_ohmic_value_val57,str1_ohmic_value_val58,str1_ohmic_value_val59,str1_ohmic_value_val60,str1_ohmic_value_val61,str1_ohmic_value_val62,str1_ohmic_value_val63,str1_ohmic_value_val64,str1_ohmic_value_val65,str1_ohmic_value_val66,str1_ohmic_value_val67,str1_ohmic_value_val68,str1_ohmic_value_val69,str1_ohmic_value_val70,str1_ohmic_value_val71,str1_ohmic_value_val72,str1_ohmic_value_val73,str1_ohmic_value_val74,str1_ohmic_value_val75,str1_ohmic_value_val76,str1_ohmic_value_val77,str1_ohmic_value_val78,str1_ohmic_value_val79,str1_ohmic_value_val80,str1_ohmic_value_val81,str1_ohmic_value_val82,str1_ohmic_value_val83,str1_ohmic_value_val84,str1_ohmic_value_val85,str1_ohmic_value_val86,str1_ohmic_value_val87,str1_ohmic_value_val88,str1_ohmic_value_val89,str1_ohmic_value_val90,str1_ohmic_value_val91,str1_ohmic_value_val92,str1_ohmic_value_val93,str1_ohmic_value_val94,str1_ohmic_value_val95,str1_ohmic_value_val96,str1_ohmic_value_val97,str1_ohmic_value_val98,str1_ohmic_value_val99,str1_ohmic_value_val100,str1_ohmic_value_val101,str1_ohmic_value_val102,str1_ohmic_value_val103,str1_vol_val0,str1_vol_val1,str1_vol_val2,str1_vol_val3,str1_vol_val4,str1_vol_val5,str1_vol_val6,str1_vol_val7,str1_vol_val8,str1_vol_val9,str1_vol_val10,str1_vol_val11,str1_vol_val12,str1_vol_val13,str1_vol_val14,str1_vol_val15,str1_vol_val16,str1_vol_val17,str1_vol_val18,str1_vol_val19,str1_vol_val20,str1_vol_val21,str1_vol_val22,str1_vol_val23,str1_vol_val24,str1_vol_val25,str1_vol_val26,str1_vol_val27,str1_vol_val28,str1_vol_val29,str1_vol_val30,str1_vol_val31,str1_vol_val32,str1_vol_val33,str1_vol_val34,str1_vol_val35,str1_vol_val36,str1_vol_val37,str1_vol_val38,str1_vol_val39,str1_vol_val40,str1_vol_val41,str1_vol_val42,str1_vol_val43,str1_vol_val44,str1_vol_val45,str1_vol_val46,str1_vol_val47,str1_vol_val48,str1_vol_val49,str1_vol_val50,str1_vol_val51,str1_vol_val52,str1_vol_val53,str1_vol_val54,str1_vol_val55,str1_vol_val56,str1_vol_val57,str1_vol_val58,str1_vol_val59,str1_vol_val60,str1_vol_val61,str1_vol_val62,str1_vol_val63,str1_vol_val64,str1_vol_val65,str1_vol_val66,str1_vol_val67,str1_vol_val68,str1_vol_val69,str1_vol_val70,str1_vol_val71,str1_vol_val72,str1_vol_val73,str1_vol_val74,str1_vol_val75,str1_vol_val76,str1_vol_val77,str1_vol_val78,str1_vol_val79,str1_vol_val80,str1_vol_val81,str1_vol_val82,str1_vol_val83,str1_vol_val84,str1_vol_val85,str1_vol_val86,str1_vol_val87,str1_vol_val88,str1_vol_val89,str1_vol_val90,str1_vol_val91,str1_vol_val92,str1_vol_val93,str1_vol_val94,str1_vol_val95,str1_vol_val96,str1_vol_val97,str1_vol_val98,str1_vol_val99,str1_vol_val100,str1_vol_val101,str1_vol_val102,str1_vol_val103,str2_ohmic_value_val0,str2_ohmic_value_val1,str2_ohmic_value_val2,str2_ohmic_value_val3,str2_ohmic_value_val4,str2_ohmic_value_val5,str2_ohmic_value_val6,str2_ohmic_value_val7,str2_ohmic_value_val8,str2_ohmic_value_val9,str2_ohmic_value_val10,str2_ohmic_value_val11,str2_ohmic_value_val12,str2_ohmic_value_val13,str2_ohmic_value_val14,str2_ohmic_value_val15,str2_ohmic_value_val16,str2_ohmic_value_val17,str2_ohmic_value_val18,str2_ohmic_value_val19,str2_ohmic_value_val20,str2_ohmic_value_val21,str2_ohmic_value_val22,str2_ohmic_value_val23,str2_ohmic_value_val24,str2_ohmic_value_val25,str2_ohmic_value_val26,str2_ohmic_value_val27,str2_ohmic_value_val28,str2_ohmic_value_val29,str2_ohmic_value_val30,str2_ohmic_value_val31,str2_ohmic_value_val32,str2_ohmic_value_val33,str2_ohmic_value_val34,str2_ohmic_value_val35,str2_ohmic_value_val36,str2_ohmic_value_val37,str2_ohmic_value_val38,str2_ohmic_value_val39,str2_ohmic_value_val40,str2_ohmic_value_val41,str2_ohmic_value_val42,str2_ohmic_value_val43,str2_ohmic_value_val44,str2_ohmic_value_val45,str2_ohmic_value_val46,str2_ohmic_value_val47,str2_ohmic_value_val48,str2_ohmic_value_val49,str2_ohmic_value_val50,str2_ohmic_value_val51,str2_ohmic_value_val52,str2_ohmic_value_val53,str2_ohmic_value_val54,str2_ohmic_value_val55,str2_ohmic_value_val56,str2_ohmic_value_val57,str2_ohmic_value_val58,str2_ohmic_value_val59,str2_ohmic_value_val60,str2_ohmic_value_val61,str2_ohmic_value_val62,str2_ohmic_value_val63,str2_ohmic_value_val64,str2_ohmic_value_val65,str2_ohmic_value_val66,str2_ohmic_value_val67,str2_ohmic_value_val68,str2_ohmic_value_val69,str2_ohmic_value_val70,str2_ohmic_value_val71,str2_ohmic_value_val72,str2_ohmic_value_val73,str2_ohmic_value_val74,str2_ohmic_value_val75,str2_ohmic_value_val76,str2_ohmic_value_val77,str2_ohmic_value_val78,str2_ohmic_value_val79,str2_ohmic_value_val80,str2_ohmic_value_val81,str2_ohmic_value_val82,str2_ohmic_value_val83,str2_ohmic_value_val84,str2_ohmic_value_val85,str2_ohmic_value_val86,str2_ohmic_value_val87,str2_ohmic_value_val88,str2_ohmic_value_val89,str2_ohmic_value_val90,str2_ohmic_value_val91,str2_ohmic_value_val92,str2_ohmic_value_val93,str2_ohmic_value_val94,str2_ohmic_value_val95,str2_ohmic_value_val96,str2_ohmic_value_val97,str2_ohmic_value_val98,str2_ohmic_value_val99,str2_ohmic_value_val100,str2_ohmic_value_val101,str2_ohmic_value_val102,str2_ohmic_value_val103,str2_vol_val0,str2_vol_val1,str2_vol_val2,str2_vol_val3,str2_vol_val4,str2_vol_val5,str2_vol_val6,str2_vol_val7,str2_vol_val8,str2_vol_val9,str2_vol_val10,str2_vol_val11,str2_vol_val12,str2_vol_val13,str2_vol_val14,str2_vol_val15,str2_vol_val16,str2_vol_val17,str2_vol_val18,str2_vol_val19,str2_vol_val20,str2_vol_val21,str2_vol_val22,str2_vol_val23,str2_vol_val24,str2_vol_val25,str2_vol_val26,str2_vol_val27,str2_vol_val28,str2_vol_val29,str2_vol_val30,str2_vol_val31,str2_vol_val32,str2_vol_val33,str2_vol_val34,str2_vol_val35,str2_vol_val36,str2_vol_val37,str2_vol_val38,str2_vol_val39,str2_vol_val40,str2_vol_val41,str2_vol_val42,str2_vol_val43,str2_vol_val44,str2_vol_val45,str2_vol_val46,str2_vol_val47,str2_vol_val48,str2_vol_val49,str2_vol_val50,str2_vol_val51,str2_vol_val52,str2_vol_val53,str2_vol_val54,str2_vol_val55,str2_vol_val56,str2_vol_val57,str2_vol_val58,str2_vol_val59,str2_vol_val60,str2_vol_val61,str2_vol_val62,str2_vol_val63,str2_vol_val64,str2_vol_val65,str2_vol_val66,str2_vol_val67,str2_vol_val68,str2_vol_val69,str2_vol_val70,str2_vol_val71,str2_vol_val72,str2_vol_val73,str2_vol_val74,str2_vol_val75,str2_vol_val76,str2_vol_val77,str2_vol_val78,str2_vol_val79,str2_vol_val80,str2_vol_val81,str2_vol_val82,str2_vol_val83,str2_vol_val84,str2_vol_val85,str2_vol_val86,str2_vol_val87,str2_vol_val88,str2_vol_val89,str2_vol_val90,str2_vol_val91,str2_vol_val92,str2_vol_val93,str2_vol_val94,str2_vol_val95,str2_vol_val96,str2_vol_val97,str2_vol_val98,str2_vol_val99,str2_vol_val100,str2_vol_val101,str2_vol_val102,str2_vol_val103 order by number

create table final(问题 varchar(200))
create table store(value varchar(4000)) --创建临时表存放数据
select identity(int,1,1) as number,* into store_temp from store
set @id = object_id('buguding_temp')
set @col = 3 --取第一行作为初始参数
while @col < 419
begin
select @a=name from syscolumns where id = object_id('buguding_temp') and colorder =@col
insert into store_temp exec('select ' + @a + ' from buguding_temp where number = 1')
set @col = @col + 1
end



set @n =2 --每一行的数据同上一行相应列值比较
while @n < 8
begin
set @col = 3 --不需要第一列行号和timestamp从第三列开始
while @col < 419
begin
select @a=name from syscolumns where id = object_id('buguding_temp') and colorder =@col
SET IDENTITY_INSERT store_temp ON
--insert into store_temp exec('select ' + @a + ' from buguding_temp where 行号 ='+@n)
insert into store_temp (number,value) exec('select 417,' + @a + ' from buguding_temp where number ='+@n)
select @getold = value from store_temp where number = @col - 2
select @getnew = value from store_temp where number = 417
if @getnew > @getold
begin
update store_temp set value = (select value from store_temp where number = 417) where number = @col -2

insert into final exec('select timestamp from buguding_temp where number =' +@n)
insert into final exec('select name as 问题列 from syscolumns where id = '+@id+' and colorder = '+@col)
insert into final exec('select value - '+@getold+' as 差值 from store_temp where number = '+@col+' -2')

end
delete from store_temp where number = 417


set @col = @col+1
end
set @n = @n +1
set @col = 1
end

相关问题