DBA > Job Interview Questions > MySQL and SQL

When would you use ORDER BY in DELETE statement?

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(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 Job Interview Questions