sql >> Base de Datos >  >> RDS >> Mysql

SUM datos después de un GROUP_CONCAT con mySQL

Prueba esto:

SELECT BIL_Date, BIL_Rate, BIL_Quantity,
GROUP_CONCAT(COALESCE(STX_Amount, "0")) AS ApplicableTaxesRate,SUM(STX_Amount)as sum
FROM ___BillableDatas
LEFT JOIN ___SalesTaxes
ON FIND_IN_SET(STX_Id, BIL_ApplicableTaxes) > 0
WHERE BIL_HotelId='cus_CNHLMiMOzP5cuM'
AND BIL_BookingId='2'
ORDER BY BIL_Date
ASC