MySQL Query Doubling Sums I am designing a query to retrieve the sum of labor hours for a given period, this query works beautifully except when I get to this sonum. All of the values are doubled. I can't for the life of me figure out what is wrong. If I do not join the tables this does not occur. Any help?

SELECT UPPER(`2016`.sonum) as sonum, SUM(`2016`.lbrhrs) as 'lbrhrs', SUM(`2016`.burhrs) as 'burhrs', MONTH(`2016`.date) as 'date', `2016`.dept as dept, closedates.closedate as 'closed date'
FROM `2016`
LEFT JOIN closedates on UPPER(`2016`.sonum)=UPPER(closedates.sonum)
WHERE `2016`.sonum=3470 and month(`2016`.`date`)=1
GROUP BY UPPER(`2016`.sonum), `2016`.dept, month(`2016`.date);
In this case, there is an easy workaround to the "explode-implode" problem that happens with JOIN + GROUP BY:

SELECT  UPPER(`2016`.sonum) as sonum,
        SUM(`2016`.lbrhrs) as 'lbrhrs',
        SUM(`2016`.burhrs) as 'burhrs',
        MONTH(`2016`.date) as 'date',
        `2016`.dept as dept,
        ( SELECT MAX(closedate)
              FROM closedates
              WHERE sonum = `2016`.sonum   -- see note below
        ) as 'closed date'   -- Here's the trick
    FROM  `2016`
    WHERE  `2016`.sonum=3470
      and  month(`2016`.`date`)=1
    GROUP BY  UPPER(`2016`.sonum),
              `2016`.dept,
              month(`2016`.date);


If sonum has any ..._ci collation, then it is "Case Insensitive", so the UPPER() is unnecessary for comparing.  Please provide SHOW CREATE TABLE for both tables.

The 'trick' is to avoid the JOIN, thereby avoiding the multiplication of rows before doing the SUMs.