You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ORDER BY of a set operation is ignored for some positions and for expressions over output columns #3147
alasql('CREATE TABLE A (a INT); INSERT INTO A VALUES (1),(3)');alasql('CREATE TABLE B (a INT); INSERT INTO B VALUES (2)');alasql('SELECT a AS k FROM A UNION SELECT a FROM B ORDER BY 1 DESC');alasql('SELECT a + 0 FROM A UNION SELECT a + 0 FROM B ORDER BY 1 DESC');alasql('SELECT * FROM A UNION SELECT * FROM B ORDER BY 1 DESC');alasql('SELECT a FROM A UNION SELECT a FROM B ORDER BY a * -1');
Each gives the rows in the order 2, 1, 3, without an error.
Each should give 3, 2, 1. SQLite gives 3, 2, 1 for the first three and refuses the expression in the last.
Activity