开发mysql时碰到问题,大家帮帮看看在mysql中怎么实现以下功能:
select top 20 * from instruments where instrCode not in (select top 10 instrCode from instruments);
我知道可以用limit但是好像limit不能用在子查询中,很郁闷啊。求高人指点。

解决方案 »

  1.   

    LIMIT有两个参数,LIMIT,OFFSET,参考一下mysql> select * from table LIMIT 5,10;  # Retrieve rows 6-15
      

  2.   

    合理利用别名select * from instruments where nstrCode not in 
    (
    select instrCode  from(select instrCode from instruments limit 10) as tb
    ) limit 20
      

  3.   

    合理利用别名select * from instruments where nstrCode not in 
    (
    select instrCode  from(select instrCode from instruments limit 10) as tb
    ) limit 20
      

  4.   

    csdn这速度,点一下以为没响应,又点了一下才提交
      

  5.   

    5.0.51a-community-log 中测试通过。