mysql用法

1:从数据库中选取第20-30项

select * from newslist limit 20,10;

2:从数据库中选择符合条件的数据表。 并按照htmlid进行逆序排放

select * from newslist where id=1 and pid=1 order
by htmlid desc

3:将符合条件的数据表逆序排放之后,选择第20,30项,也就是原数据库 的倒数第20-30项

select * from (select * from newslist where id=1 and pid=1 order
by htmlid desc)t1 limit 20,10;

猜你喜欢

转载自www.cnblogs.com/liyafei/p/9065557.html