< Br /> id < /th>
data < /th>
< /tr>
< /thead>
1 < /td>
2025-01-01 < /td>
< /tr>
2
2025-02-02
table reftypes < /p>
idrefappointment < /th>
idreftype < /th>
< /tr>
< /thead>
< tbody>
1 < /td>
1 < /td>
< /tr>
1
2
Таблица типов < /p>
id < /th>
Описание < /th>
< /tr>
< /thead>
1 < /td>
a < /td>
< /tr>
2
b
Код: Выделить всё
SELECT id, GROUP_CONCAT(Types.description) as desc
from Appointments
left join RefTypes on Appointments.id = RefTypes.idRefAppointment
left join Types on RefTypes.idRefType = Types.id
Подробнее здесь: https://stackoverflow.com/questions/794 ... d-by-comma