SUM datas after a GROUP_CONCAT with mySQL

后端 未结 1 942
醉话见心
醉话见心 2021-01-23 18:56

I\'m using phpMyAdmn and I\'ve this query in mySQL:

SELECT BIL_Date, BIL_Rate, BIL_Quantity,
GROUP_CONCAT(COALESCE(STX_Amount, \"0\")) AS ApplicableTaxesRate
FRO         


        
1条回答
  •  离开以前
    2021-01-23 19:46

    Try this :

    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
    

    0 讨论(0)
提交回复
热议问题