[Solved] How to Sum a single Column based on grouping in MySQL


You can try this
SqlFiddle Demo

SELECT
    BrandMaster.BID,          
    IFNULL(SUM(Sales.Amount),0) AS SumAmount
FROM BrandMaster 
    LEFT JOIN Sales ON ( BrandMaster.BID=Sales.BID )
GROUP BY
    BrandMaster.BID
ORDER BY 
    BrandMaster.BID,
    Sales.SNo

solved How to Sum a single Column based on grouping in MySQL