Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

SUM datas após um GROUP_CONCAT com mySQL


Tente isto:
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