I am aware that the Group Concat function cannot be used in SQL Server, but in this particular case, my query needs to be Group Concat'ed. I googled it and discovered some logic, but I was unable to fix it. My SQL command is:
select m.maskid,m.maskname,m.schoolid,s.schoolname,
md.maskdetail
from tblmask m join school s on s.id = m.schoolid
join maskdetails md on m.maskid = md.maskid
order by m.maskname ;
Output:

The first three rows only Since the maskid, maskname, schoolid, and schoolname are all the same but the maskdetail is different, we need to create a row for that in which the last column can have all of the maskdetails according to the maskid, and so on.
Expected output:

Can someone please help me with this?