Condition Pushdown into Derived Table Optimization
Last updated
Was this helpful?
Was this helpful?
SELECT
customer_id,
SUM(amount) AS TOTAL_AMT
FROM orders
WHERE order_date BETWEEN '2017-10-01' AND '2017-10-31'
GROUP BY customer_id
HAVING
customer_id=1 SELECT
customer_id,
SUM(amount) AS TOTAL_AMT
FROM orders
WHERE
order_date BETWEEN '2017-10-01' AND '2017-10-31' AND
customer_id=1
GROUP BY customer_id