求教一个table 有5条记录, 如何删除3到4行的数据4
7
3
9
5删完之后,剩下4
7
5

解决方案 »

  1.   

    mysql> select * from tx;
    +------+
    | id   |
    +------+
    |    4 |
    |    7 |
    |    3 |
    |    9 |
    |    5 |
    +------+
    5 rows in set (0.05 sec)mysql> delete a from tx a inner join (select * from tx limit 2,2) b on a.id=b.id;
    Query OK, 2 rows affected (0.11 sec)mysql> select * from tx;
    +------+
    | id   |
    +------+
    |    4 |
    |    7 |
    |    5 |
    +------+
    3 rows in set (0.01 sec)mysql>