title: Mysql subquery for sum all columns in inner Join
body: <p>I am attempting to get the sum of 12 columns (in same table) in a subquery in an inner join. 
  Here is a link to my schema :</p>
  
  <p><a href="http://sqlfiddle.com/#!9/62de4/1" rel="nofollow">SqlFiddle</a></p>
  
  <p>The query I am attempting to use is this:</p>
  
  <pre><code>SELECT 
  `inventory`.`part_number`,
  `inventory`.`qty`,
  `inventory`.`description`,
  `reorder`.`reorder_point` * '1' `point`,
  `inventory`.`cost`,
  `vendor`.`name` AS `vendor_name`,    SELECT (SUM(`saleshistory`.`Sales_1_Month_Prior`)+SUM(`saleshistory`.`Sales_2_Month_Prior`)+SUM(`saleshistory`.`Sales_3_Month_Prior`)+SUM(`saleshistory`.`Sales_4_Month_Prior`)+SUM(`saleshistory`.`Sales_5_Month_Prior`)+SUM(`saleshistory`.`Sales_6_Month_Prior`)+SUM(`saleshistory`.`Sales_7_Month_Prior`)+SUM(`saleshistory`.`Sales_8_Month_Prior`)+SUM(`saleshistory`.`Sales_9_Month_Prior`)+SUM(`saleshistory`.`Sales_10_Month_Prior`)+SUM(`saleshistory`.`Sales_11_Month_Prior`)+SUM(`saleshistory`.`Sales_12_Month_Prior`) AS TTL
  FROM `inventory`
  LEFT JOIN `reorder` ON `inventory`.`part_number` = `reorder`.`part_number`
  LEFT JOIN `vendor` ON `inventory`.`vendor` = `vendor`.`vendor_id`
  INNER JOIN `saleshistory` ON `saleshistory`.`location` =     `inventory`.`location` AND `saleshistory`.`part_number` = `inventory`.`part_number`
  WHERE `inventory`.`qty` &lt;= `reorder`.`reorder_point`
  AND `inventory`.`location` = '99'
  AND `reorder`.`reorder_point` != '0'
  GROUP BY `inventory`.`part_number`
  ORDER BY `vendor`.`name` ASC
  </code></pre>
  
  <p>When using this query, it returns all the values for all the records not just the rows.</p>