このトピックでは、EQLのグルーピング動作のうち、注意が必要なものについて説明します。
SELECT COUNT(SUM(sales)) AS totals GROUP // Invalid SELECT COUNT(sales) AS totals, SUM(totals) AS totals2 GROUP // Invalid
SELECT sales AS totals GROUP // Valid implicit ARB SELECT ARB(sales) AS sales GROUP // Valid explicit ARB
SELECT sales AS totals, COUNT(totals) AS totals2 GROUP // Invalid SELECT ARB(sales) AS totals, COUNT(totals) AS totals2 GROUP // Invalid
SELECT sales AS sales, COUNT(sales) AS totals GROUP // Invalid SELECT ARB(sales) AS sales, COUNT(sales) AS totals GROUP // Invalid
SELECT sales AS sales1, COUNT(sales) AS totals GROUP // Valid SELECT ARB(sales) AS sales1, COUNT(sales) AS totals GROUP // Valid
SELECT stmt1 AS SELECT amount AS amount; SELECT stmt2 AS SELECT amount+1 AS stmt1_amount, amount+2 AS amount, amount+3 AS stmt2_amount FROM stmt1
SELECT stmt1 AS SELECT amount AS amount; SELECT GROUPING(amount) AS stmt1_amount, amount AS amount, GROUPING(amount) AS stmt2_amount, orders AS orders, FROM stmt1 GROUP BY CUBE(amount, orders)
SELECT COUNT(sales) AS cnt GROUP BY totals, price SELECT COUNT(sales) AS cnt, totals AS totals, price AS price GROUP BY totals, price
この影響を受けるのは、コンストラクトのうち、集計前と集計後の動作が異なるもののみです。たとえば、GROUPING関数です。