I have looked around and can't find an answer to this.
I was wondering if there is a way in MY SQL Workbench where you can add a default
ORDER BY id DESC
SELECT * FROM payments
SELECT * FROM payments ORDER BY id DESC
is there a way in MY SQL Workbench where you can add a default ORDER BY to every query?
What's more, result sets from SQL queries present their rows in a formally unpredictable order in the absence of
ORDER BY clauses sufficient to determine the order. A lot of people get tripped up by this: they assume that because a result set appeared in a certain order yesterday, it will appear in the same order today. It does until it doesn't. If a program relies on ordering when it isn't specified in an ORDER BY clause, well, see Murphy's Law.
Ditto for software versions. People sometimes mistakenly believe it's a defect in a new version of a RDMS server like MySQL when it presents results in a different order from the preceding version. It isn't.
This can help performance. Ordering can be a time- and space- hog of an operation. When the query planner knows it doesn't have to order rows in a result set, it can just present them in whatever order it finds them.