Skip to content

Parser failing on nested case statements #1306

Closed
@salonijuneja

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions