1、取数据库最后30个数据
select x,y from sin order by id desc limit 0,30;
2、将数据再反序,横坐标反转
select * from (select x,y from sin order by id desc limit 0,30) as sinxy order by sinxy.x asc ;