my query sum of total qty , sum of total returned qty. got answers individually need combine. select c.city_name ,pc.prod_cat_name ,to_char(th.txn_date, 'w') ,to_char(th.txn_date, 'yyyy') ,sum(td.qty) city c ,prod_cat pc ,product p ,txn_hdr th ,txn_det td ,store_det s ,state st c.state_id = st.state_id , s.city_id = c.city_id , s.store_id = th.store_idand th.txn_hdr_id = td.txn_hdr_id , td.prod_id = p.prod_id , p.prod_cat_id = pc.prod_cat_id group c.city_name ,pc.prod_cat_name ,to_char(th.txn_date, 'w') ,to_char(th.txn_date, 'yyyy') output bangalore electronics 1 2015 1 bangalore electronics 3 2015 1 bangalore clothing 2 2015 1 bangalore clothing 1 2015 2 chennai stationary 1 2015 10 chennai cars_bike 4 2015 5 bangalore clothing 3 2015 4 second query select c....