Please help make a request for the following situation: 
The case when the server has a separate cabinet for switches and a separate for patch panels. When the circuit was linear and there was a condition that everything is in the same cabinet, I just did it through LEFT JOIN :
SELECT boxs.box, switchs.switch, path_panels.path_panel FROM info LEFT path_panels ON info.id_patch_panels = path_panels.id_patch_panels LEFT JOIN switchs ON info.id_switchs = switchs.id_switchs LEFT JOIN boxs ON info.id_boxs = boxs.id_boxs Now I have added the id_boxs2 column to info and I don’t know how to get the output in the grid in the following order: Шкаф, Коммут., Шкаф2, Патч-панель . It is also not possible to do linearly.