I\'m using MySql V5.7. I have a table PatientAppointment. I need to GROUP BY CDRId which is a column in the same table. Here\'s the query:
GROUP BY
Unfortunately, SQL has no way of "merging table cells" like you show in your screenshot. SQL is not like a spreadsheet.
You must fetch the rows and then work out in application code how you want to group them.
(You asked me on another thread to come here and give an answer.)