PHP
- 0 ответов
- 0 вопросов
1
Вклад в тег
SELECT Request.r_id, ROpt_City.container, ROpt_Filial.container, UOptions.container
FROM Request
LEFT JOIN ROLink ON (ROLink.r_id = Request.r_id)
LEFT JOIN ROptions AS ROpt_City ON (ROLink.op_id = ROpt_City.op_id AND ROpt_City.name = 'город')
LEFT JOIN ROptions AS ROpt_Filial ON (ROLink.op_id = ROpt_Filial.op_id AND ROpt_City.name = 'филиал')
LEFT JOIN UOLink ON (ROpt_City.op_id = OULink.op_id OR ROpt_Filial.op_id = OULink.op_id)
LEFT JOIN UOptions ON (UOLink.op_id = UOptions.op_id AND UOptions.name = 'ФИО')