Details
Description
following statement represents a simplified query; I simulate a 3-row table with a union statement.
order by in the inner subselect does not affect the order of the outer select
in mysql it does.
statement:
SELECT * FROM (SELECT * FROM (SELECT 'a' UNION SELECT 'b' UNION SELECT 'c' )t order BY a desc)t
result: a,b,c
in Mysql: c,b,a (correct)
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Please see https://mariadb.com/kb/en/mariadb/faq/general-faq/why-is-order-by-in-a-from-subquery-ignored/