Example:

mysql> select id,name from student_detail limit 20;
+—-+—————–+
| id | name            |
+—-+—————–+
|  1 | SIVASANKARAN.S. |
|  2 | SELVAM P.       |
|  3 | MANIKANDAN  A   |
|  4 | KIRUTHIKA K     |
|  5 | PERIYANNAN K    |
|  6 | ANBU CHOZHAN    |
|  7 | DIVYA R         |
|  8 | ANJALAI M       |
|  9 | VASANTHI S      |
| 10 | BHUVANESHWARI M |
| 11 | SATHYA S        |
| 12 | KANAGA M        |
| 13 | JHON PALRAJ.A   |
| 14 | AMSAVALLI K     |
| 15 | RENGANATHAN M   |
| 16 | ANTHONI MANOJ.F |
| 17 | MANJU S         |
| 18 | VIJAYAKUMAR     |
| 19 | SELVAM S        |
| 20 | MARIYAPPAN P    |
+—-+—————–+
If you want to delete the records from 11 to 15 use the following query

mysql> delete from student_detail where id between 11 and 15;

mysql> select id,name from student_detail limit 20;
+—-+—————–+
| id | name            |
+—-+—————–+
|  1 | SIVASANKARAN.S. |
|  2 | SELVAM P.       |
|  3 | MANIKANDAN  A   |
|  4 | KIRUTHIKA K     |
|  5 | PERIYANNAN K    |
|  6 | ANBU CHOZHAN    |
|  7 | DIVYA R         |
|  8 | ANJALAI M       |
|  9 | VASANTHI S      |
| 10 | BHUVANESHWARI M |
| 16 | ANTHONI MANOJ.F |
| 17 | MANJU S         |
| 18 | VIJAYAKUMAR     |
| 19 | SELVAM S        |
| 20 | MARIYAPPAN P    |
+—-+—————–+

Advertisements