Interview Questions

When would you use ORDER BY in DELETE statement?

MySQL and SQL


(Continued from previous question...)

When would you use ORDER BY in DELETE statement?

When you’re not deleting by row ID. Such as in DELETE FROM techinterviews_com_questions ORDER BY timestamp LIMIT 1. This will delete the most recently posted question in the table techinterviews_com_questions.

(Continued on next question...)

Other Interview Questions