This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | DELETE | |
| FROM | |
| `table` AS p | |
| JOIN | |
| ( SELECT id | |
| FROM `table` | |
| ORDER BY id DESC | |
| LIMIT 1 OFFSET N | |
| ) AS lim | |
| ON p.id <= lim.id; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | DELETE FROM `table` | |
| WHERE id <= ( | |
| SELECT id | |
| FROM ( | |
| SELECT id | |
| FROM `table` | |
| ORDER BY id DESC | |
| LIMIT 1 OFFSET N | |
| ) lim | |
| ) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | DELETE FROM `table` | |
| WHERE id NOT IN ( | |
| SELECT id | |
| FROM ( | |
| SELECT id | |
| FROM `table` | |
| ORDER BY id DESC | |
| LIMIT N | |
| ) lim | |
| ); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | DELETE c.* | |
| FROM table c | |
| LEFT JOIN | |
| ( | |
| SELECT id | |
| FROM table a | |
| ORDER BY id DESC | |
| LIMIT N | |
| ) b | |
| ON a.id = b.id | 
NewerOlder