Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'thakk623_thakkarapp.tbl_productinventory.sub_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
select sub_id,pid,sum(qty) as totalqty,sum(sell_qty) as totalsell,sum(scrap_qty) as totalscrap from tbl_productinventory where pid='27' and sold='No' group by pid order by cid desc