在三个表的内连接中由另一列分组的两列相乘的总和返回错误的值

Sum of a multiplication of two columns grouped by another column in an inner join of three tables returns wrong value. Below are my three tables:

Table1: enter image description here

Table2:

enter image description here

Table3:

enter image description here

My Query is as below:

SELECT c.price, c.quantity, SUM( c.quantity * c.price ) AS price, 
group_concat( a.rate
SEPARATOR '<br>' ) AS rates, c.hsn AS hsn
FROM tax_wa a
INNER JOIN tax_rate_class b ON a.tax_rate_id = b.tax_rate_id
INNER JOIN inv_item c ON b.tax_class_id = c.tax_class_id
WHERE c.invoice_id = '17'
GROUP BY c.hsn

And the result is:

enter image description here

But above one is not correct... To expain it, if you run the below query on the inv_item table (alone, with no joins) you get correct results:

SELECT price, quantity, sum( quantity * price )
FROM `inv_item`
WHERE invoice_id = '17'
GROUP BY hsn

Result is good:

enter image description here

Above result the wrong value calculated if you add all

Presumably, you want the sum():

SELECT SUM(c.price),  SUM(c.quantity), SUM( c.quantity * c.price ) AS price, 
       group_concat( a.rate SEPARATOR '<br>' ) AS rates, c.hsn AS hsn
FROM tax_wa a INNER JOIN
     tax_rate_class b
     ON a.tax_rate_id = b.tax_rate_id INNER JOIN
     inv_item c
     ON b.tax_class_id = c.tax_class_id
WHERE c.invoice_id = 17
GROUP BY c.hsn;