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
Unable to get property 'modifier' of undefined or null reference #635
Describe the problem:
--- I have multiple select statements strung together with EXCEPT or INTERSECT between them. To order by with multiple selects, you usually add ORDER BY at the end. When I do order by at the end, I get the error in the title of the issue. The error points to alasql.min.js at line 2, char 9585, code 0
Provide code that replicates the problem:
--- "SELECT * FROM Persons INTERSECT SELECT * FROM Persons WHERE eventStart BETWEEN x AND x OR eventEnd BETWEEN x AND x ORDER BY eventStart"
x's are just unix timestamps, I left them out for clarity.
Found out (...) idea does not work. The parser cant handle it.
The SELECT * part wont work.
alasql('SELECT * FROM $0 INTERSECT SELECT * FROM $0',[[{eventStart:1},{eventStart:100},{eventStart:10}]])
gives an empty result
Naming what you select will work
alasql('SELECT eventStart FROM $0 INTERSECT SELECT eventStart FROM $0',[[{eventStart:1},{eventStart:100},{eventStart:10}]])
will give 3 results as expected.
The ORDER BY is not working (as you state) so in the last example the order will be 1,100,10
Workaround is to have this select as a subquery and ÒRDER BY` on the main query - so try something like:
alasql('SELECT * FROM (SELECT eventStart FROM $0 INTERSECT SELECT eventStart FROM $0) ORDER BY eventStart',[[{eventStart:1},{eventStart:100},{eventStart:10}]])
Bonus input: I hope the query is only to illustrate the problem. It does not make much sense to intersect with the same table.
Activity
mathiasrw commentedon Mar 24, 2016
Have you tried putting
(...)around?mathiasrw commentedon Mar 24, 2016
Ok - some inputs
(...)idea does not work. The parser cant handle it.SELECT *part wont work.alasql('SELECT * FROM $0 INTERSECT SELECT * FROM $0',[[{eventStart:1},{eventStart:100},{eventStart:10}]])gives an empty result
alasql('SELECT eventStart FROM $0 INTERSECT SELECT eventStart FROM $0',[[{eventStart:1},{eventStart:100},{eventStart:10}]])will give 3 results as expected.
ORDER BYis not working (as you state) so in the last example the order will be 1,100,10alasql('SELECT * FROM (SELECT eventStart FROM $0 INTERSECT SELECT eventStart FROM $0) ORDER BY eventStart',[[{eventStart:1},{eventStart:100},{eventStart:10}]])Bonus input: I hope the query is only to illustrate the problem. It does not make much sense to intersect with the same table.
Respect ORDER BY in INTERSECT/EXCEPT queries to fix AlaSQL#635 (AlaSQ…
mathiasrw commentedon Dec 6, 2025
Fix released as part of v4.11.0