操作数据的时候,中间需要断开一次,但表中数据id是不连续的 ,为了下次运行从所断掉的id处开始,所以记录断开时的id:416641,查看这条数据在数据库表中是第几条:
- SELECT count(*) from (SELECT * FROM fortress.x_media_assets_publish ORDER BY id) as a
- where id >= (SELECT id from fortress.x_media_assets_publish where id = '416641')
得到在数据库的条数:158015;然后再查询从这条开始向后的数据:
SELECT * FROM fortress.x_media_assets_publish limit 158015,999999999