将cq_action表的第3条后面的5条记录查询出来。
表中有id,nextid,failid等字段,谢谢大家

解决方案 »

  1.   

     INSERT INTO cq_action (`id`,`id_next`,`id_nextfail`,`type`,`data`,`param`) VALUES 
     (8519000,8519010,8519001,1051,0,'level < 37'),
     (8519001,8519020,8519002,1192,3520,'flag == 1'),
     (8519002,8519030,8519003,1192,3520,'flag == 0'),
     (8519003,8519030,8519004,1192,3519,'flag == 0'),
     (8519004,8519030,8519005,1192,3518,'flag == 0'),
     (8519005,8519030,8519006,1192,3517,'flag == 0'),
     (8519006,0,8519040,1192,3516,'flag == 0');
     Id为第一个属性
     数据如果有按照ID大小进行存储,则好实现
    结果为Select * from cq_action where id not in(select top 3 id from cq_action) limit 5;
    如果Id没按大小存储,该如何实现
    Select * from cq_action where id not in(select top 3 * from cq_action) limit 5;
    这样会报错,提示子查询错误什么的 
    如果行的话 回答一下为什么会报错
      

  2.   

    try:
    select * from tt order by id limit 2,5
      

  3.   


    包括第三条
    limit 2,5
    不包括第三条
    limit 3,5
      

  4.   

    select * from tt order by id limit 3,5
    是将ID排序好后取第三条之后的五条
    若取原记录中,结果是不是应该为
    select * from cq_action limit 3,5