---
title: "When would you use ORDER BY in DELETE statement?"  
description: "When would you use ORDER BY in DELETE statement?"  
author: "Anonymous User"  
published: 2012-04-09  
updated: 2020-09-24  
canonical: https://www.mindstick.com/interview/1423/when-would-you-use-order-by-in-delete-statement  
category: "mysql"  
tags: ["mysql"]  
reading_time: 1 minute  

---

# When would you use ORDER BY in DELETE statement?

When are you not deleting by row ID. Such as in DELETE FROM techpreparation_com_questions ORDER BY timestamp LIMIT 1. This will delete the most recently posted question in the table techpreparation_com_questions.

## Answers

### Answer by Anonymous User

When are you not deleting by row ID. Such as in DELETE FROM techpreparation_com_questions ORDER BY timestamp LIMIT 1. This will delete the most recently posted question in the table techpreparation_com_questions.


---

Original Source: https://www.mindstick.com/interview/1423/when-would-you-use-order-by-in-delete-statement

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
