In the image, I have two records that have the same payment ID, and I sum everything related to that payment ID but when I try to show it separate items I come across a problem when someone pays the amount that they pay will be stored and I don't know how to hide the duplicates, sorry for little info, but I wanna make paid amount column to show that 600 once and for the next row be empty is that possible by query or its fixed in visual studio
total paid amount
300 600
300 //this cell be empty Query:
select `payment`.`id_payment` as `Payment ID`,
`payment`.`doctor_id` as `Doctor ID`,
`patient_information`.`id_user` as `Code`,
CONCAT (`patient_information`.`firstname`,
' ', `patient_information`.`middlename`,
' ',
`patient_information`.`lastname`) as `Customer`,
`payment`.`date` as `Date`,
`bills`.`name` as `Tretment`,
(COALESCE(SUM(`items`.`sell_price`),0)+sum(`bills`.`price`)) as `Total`,
`payment`.`amount` as `Paid amount`,
`payment`.`discount`,
`payment`.`status` as `Status`,
COALESCE(sum(items.price),0) as `R.M`,
(COALESCE(sum(items.sell_price),0)+`bills`.`price`) - sum(items.price) AS `G.P`
from (((((`payment` `payment`
inner join `patient_information`
`patient_information`
on (`patient_information`.`id_user` = `payment`.`paitent_id`))
inner join `paymen_information`
`paymen_information`
on (`paymen_information`.`id_payment` = `payment`.`id_payment`))
inner join `bills` `bills`
on (`bills`.`id_bill` = `paymen_information`.`id_bill`))
inner join `bill_information` `bill_information`
on (`bill_information`.`bills_id` = `bills`.`id_bill`))
inner join `items` `items`
on (`items`.`id_item` = `bill_information`.`item_id`))
WHERE payment.date BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY) AND CURRENT_DATE()
GROUP by `payment`.`id_payment`,`bills`.`id_bill`,`paymen_information`.`id`
