SELECT LEFT(SN,6) as Model,count(*) as TestQty,avg(SpanTime) as TestingTime FROM (SELECT * FROM (SELECT TOP 10
SN,STATION,STARTTIME,ENDTIME,RESULT,SpanTime from FTNTRACK where STATION = 'FT01' AND LEFT(SN,6) = 'FWF50B' and result = 'true' ORDER BY ENDTIME desc) A
union all SELECT * FROM (SELECT TOP 10
SN,STATION,STARTTIME,ENDTIME,RESULT,SpanTime from FTNTRACK where STATION = 'FT01' AND LEFT(SN,6) = 'FG100C' and result = 'true' ORDER BY ENDTIME DESC) B
) C Where STATION='FT01'and result = 'true'group by LEFT([SN],6)
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
OK啦。。。。。。高