LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
53 stars 24 forks source link

[FRG-240] parser allows queries where it should only allow subqueries #632

Open dynamobi-build opened 12 years ago

dynamobi-build commented 12 years ago

[reporter="jvs", created="Fri, 8 Dec 2006 16:57:02 -0500 (GMT-05:00)"] In this example, it should require two levels of parens between sum and select (one for the sum functional syntax, and one for the scalar subquery).

select sum(SELECT
        CASE WHEN "VLE_OPTY_STATUS"."LE_DOMAIN_2" = 'LOST' THEN CASE WHEN "OPPORTUNITY"."ACT_OPTY_CLOSE_DK" > "OPPORTUNITY"."OPTY_START_DK" THEN "OPPORTUNITY"."ACT_OPTY_CLOSE_DK" - "OPPORTUNITY"."OPTY_START_DK" ELSE 0 END ELSE 0 END
    FROM "system_SFDC_NTST_TEST"."VLE_OPTY_STATUS" AS "VLE_OPTY_STATUS"
    WHERE "VLE_OPTY_STATUS"."STATUS_KEY" = "OPPORTUNITY"."OPTY_STATUS_KEY") as "m3"
from "OPPORTUNITY"