Hi tamilselvan,
I tried using the rollup too...but with having conditions it doesn't work....I mean no errors are generated but query output is same as without using the rollup.
best regardsCode:Select extract(year from order_date) "Year", sales_rep_id "Salesperson", customer_id "Customer", sum(order_total) "Order Total", count(*) "Orders" FROM oe.orders WHERE order_mode = 'direct' GROUP BY grouping sets (customer_id, sales_rep_id, rollup(extract(year from order_Date))) HAVING customer_id BETWEEN 100 AND 105 OR sales_rep_id BETWEEN 155 AND 160 or extract(year from sysdate) >= extract(year from order_date) /




Reply With Quote