22,300
社区成员




update a set a.differencefe=t.chazhi
from Entity_69052 a,
(
select slotnum
,MAX(CAST(ContentFe AS FLOAT))-MIN(CAST(ContentFe AS FLOAT)) as chazhi
,MAX(ExamineTime) as maxtime from Entity_69052 where ExamineTime<(select Max(ExamineTime) from Entity_69052 where Entity_69051_FK ='{0}')
group by slotnum
) t
where a.slotnum = t.slotnum and a = t.maxtime and t.chazhi is not null
语法上没问题~不知道数据是啥样的
select differencefe
from (
select slotnum
,MAX(CAST(ContentFe AS FLOAT))-MIN(CAST(ContentFe AS FLOAT)) as chazhi
,MAX(ExamineTime) as maxtime from Entity_69052 where ExamineTime<(select Max(ExamineTime) from Entity_69052 where Entity_69051_FK ='{0}')
group by slotnum) t
where Entity_69052.slotnum = t.slotnum and ExamineTime = t.maxtime and t.chazhi is not null
这个语句您能查到值么?查不到的话自然就没法赋值啊。[/quote
感谢你回答我的问题,我想问我写的对不对,,,数据库影噶能查到这个数据,我应该是写错了,求改写
select differencefe
from (
select slotnum
,MAX(CAST(ContentFe AS FLOAT))-MIN(CAST(ContentFe AS FLOAT)) as chazhi
,MAX(ExamineTime) as maxtime from Entity_69052 where ExamineTime<(select Max(ExamineTime) from Entity_69052 where Entity_69051_FK ='{0}')
group by slotnum) t
where Entity_69052.slotnum = t.slotnum and ExamineTime = t.maxtime and t.chazhi is not null
这个语句您能查到值么?查不到的话自然就没法赋值啊。