Skip to content

Parser failing on nested case statements #1306

Closed

Description

@salonijuneja

SELECT CASE
WHEN 'USD' = 'USD'
THEN 0
ELSE CASE
WHEN 'USD' = 'EURO'
THEN ( CASE
WHEN 'A' = 'B'
THEN 0
ELSE 1
END * 100 )
ELSE 2
END
END AS "column1"
FROM test_schema.table_name

Tested here

However it works correctly when I put brackets around inner case statement.
The query given above is a valid query.

Activity

  1. manticore-projects commented on Aug 18, 2021

    @manticore-projects
    Contributor

    Greetings,

    thank you for reporting. I will look at it.

  2. added a commit that references this issue on Aug 25, 2021
    123face
  3. added 2 commits that reference this issue on Aug 28, 2021
    8f632b9
    2e87613
  4. added a commit that references this issue on May 15, 2024
    21e5eba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions