Skip to content

Unable to get property 'modifier' of undefined or null reference #635

Closed

Description

@linus72982
  • 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.

Activity

  1. mathiasrw commented on Mar 24, 2016

    @mathiasrw
    Member

    Have you tried putting (...) around?

  2. mathiasrw commented on Mar 24, 2016

    @mathiasrw
    Member

    Ok - some inputs

    • 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.

  3. added a commit that references this issue on Dec 4, 2025
    d206837
  4. mathiasrw commented on Dec 6, 2025

    @mathiasrw
    Member

    Fix released as part of v4.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions