Details
Description
CREATE DATABASE `derived_issue`; CREATE TABLE `derived_issue`.`test` ( `num` int(11) NOT NULL ); INSERT INTO `derived_issue`.`test` (num) VALUES (12345),(1),(1234),(12),(123),(123456); SELECT * FROM ( SELECT num FROM `derived_issue`.`test` ORDER BY num DESC ) derived_table;
on MariaDB the derived_table result
12345 1 1234 12 123 123456
on MySQL the results is what is expected
123456 12345 1234 123 12 1
not matter what engine or version you use the MariaDB give wrong order
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Close this ticket i found the answer
https://mariadb.com/kb/en/mariadb/why-is-order-by-in-a-from-subquery-ignored/