智者无忧(提问者)select *
from
(
SELECT (@i:=@i + 1) i,machine_code as 机台,output,epp,create_time,if(ps<${停车指标},0,1) AS MM
FROM ${工序},(select @i:=0) t2
WHERE create_time between \'${起始时间}\' and \'${结束时间}\' ${if(len(机台)==0,\"\",\"and machine_code=\'\"+机台+\"\'\")}
ORDER BY machine_code,create_time
) a
where i%${精准度}=0
为什么上面这个数据库查询语句是可以运行的