Voeg IF-voorwaarde toe aan SQL-query, zoiets als dit.
SELECT invoice_details.invoice_no,
invoice_details.invoice_date,
invoice_details.invoice_amount,
SUM(IF(received_amount_details.received_amount IS NULL
OR received_amount_details.received_amount = '', 0.0,
received_amount_details.received_amount)) AS totalreceiptamt
FROM (SELECT DISTINCT invoice_no,
received_amount
FROM received_amount_details) AS received_amount_details
right join invoice_details
ON received_amount_details.invoice_no =
invoice_details.invoice_no
WHERE invoice_details.proje_id = '7'
GROUP BY invoice_details.invoice_no
Dit voegt 0,0 toe aangezien de standaardwaarde niet Received_amount_details is.received_amount IS NULL of leeg
We doen ook goed mee te doen om alle waarden van de pagina factuur_details te krijgen.
U kunt hier meer leren over de IF-conditie in MYSQL,
https://www.w3schools.com/mysql/func_mysql_if.asp https://dev.mysql.com/doc/refman/8.0 /en/if.html