-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subquery inside CASE...WHEN... should not have alias added #2905
Comments
Adding Line 1845 in c5aa497
|
Thanks, this should be fixed now. SELECT
CASE ("t1"."metadata"->>'price' IS NULL)
WHEN 1 THEN (
SELECT sum("products_recordset"."price" * "products_recordset"."quantity")
FROM jsonb_populate_recordset(NULL::universal.al_items, "t1"."metadata"->'products') AS "products_recordset")
ELSE (CAST(CAST("t1"."metadata"->>'price' AS text) AS double precision) * "t1"."quantity")
END
FROM "orderitems" AS "t1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given following example of using a subquery inside a
CASE...WHEN...
expression:Expected:
The desired SQL output should be as follow:
Current output:
An extra alias was added to the subquery, causing invalid syntax.
Database is PostgreSQL.
The text was updated successfully, but these errors were encountered: