在mysql中给查询的结果添加序号列

SELECT * FROM (
SELECT
(@i:=@i+1) as i, id, data_send_time
FROM
jl_pims_machine_time mt,(select @i:=0) as it order by mt.id desc
) tmp
WHERE
i IN (1,3,5)

posted on 2017-07-18 15:45  果然朝辉  阅读(239)  评论(0编辑  收藏  举报

导航