- SELECT keyword FROM keyword_rank WHERE advertiserid='59' order by keyword LIMIT 2 OFFSET 1;
比如这个SQL ,limit后面跟的是2条数据,offset后面是从第1条开始读取
- SELECT keyword FROM keyword_rank WHERE advertiserid='59' order by keyword LIMIT 2 ,1;
而这个SQL,limit后面是从第2条开始读,读取1条信息。这两个千万别搞混哦。
那么 返回第pagenumber页,每页条数为pagesize的sql语句写法为
- SELECT keyword FROM keyword_rank LIMIT (pagenumber-1)*pagesize,pagesize;
- SELECT keyword FROM keyword_rank LIMIT pagesize OFFSET (pagenumber-1)*pagesize;
sfds