如何从表中删除一些指定行

时间:2017-06-17 05:47:41

标签: mysql

我有一张测试表

mysql> select * from test1 limit 20;
+------+------+----------------------------------+
| id   | num  | pass                             |
+------+------+----------------------------------+
|    1 |    1 | c4ca4238a0b923820dcc509a6f75849b |
|    2 |    3 | c81e728d9d4c2f636f067f89cc14862c |
|    1 |    1 | c4ca4238a0b923820dcc509a6f75849b |
|    2 |    2 | c81e728d9d4c2f636f067f89cc14862c |
|    1 |    1 | c4ca4238a0b923820dcc509a6f75849b |
|    2 |    3 | c81e728d9d4c2f636f067f89cc14862c |
|    3 |    3 | eccbc87e4b5ce2fe28308fd9f2a7baf3 |
|    4 |    6 | a87ff679a2f3e71d9181a67b7542122c |
|    5 |    7 | e4da3b7fbbce2345d7772b0674a318d5 |
|    6 |    6 | 1679091c5a880faf6fb5e6087eb1b2dc |
|    7 |    8 | 8f14e45fceea167a5a36dedd4bea2543 |
|    8 |   11 | c9f0f895fb98ab9159f51fd0297e236d |
|    9 |   10 | 45c48cce2e2d7fbdea1afc51c7c6ad26 |
|   10 |   12 | d3d9446802a44259755d38e6d163e820 |
|   11 |   12 | 6512bd43d9caa6e02c990b0a82652dca |
|   12 |   18 | c20ad4d76fe97759aa27a0c99bff6710 |
...

我想删除第1行,第3行和第9行。所以我使用这样的命令

delete from test1 limit 1,3,9;

但它不起作用,有没有解决方法可以做到这一点?

0 个答案:

没有答案