-
Sreeharsha Ramanavarapu authored
IN SELECT LIST '*', PRODUCES ERROR ISSUE: ------ The query EXISTS(SELECT *...) is transformed to EXISTS(SELECT 1 ...) before all the columns in the inner subquery have been resolved. Since mysql allows HAVING without GROUP BY, the columns in the HAVING clause will need to resolve to the SELECT list. Replacing * with 1 effectively eliminates this possibility. SOLUTION: --------- The transformation of EXISTS(SELECT *...) to EXISTS(SELECT 1 ...) will not applied if there is a HAVING clause in the inner subquery.
Sreeharsha Ramanavarapu authoredIN SELECT LIST '*', PRODUCES ERROR ISSUE: ------ The query EXISTS(SELECT *...) is transformed to EXISTS(SELECT 1 ...) before all the columns in the inner subquery have been resolved. Since mysql allows HAVING without GROUP BY, the columns in the HAVING clause will need to resolve to the SELECT list. Replacing * with 1 effectively eliminates this possibility. SOLUTION: --------- The transformation of EXISTS(SELECT *...) to EXISTS(SELECT 1 ...) will not applied if there is a HAVING clause in the inner subquery.
Loading