So that in request there was a condition:

SELECT * FROM Table IF(cond) LEFT JOIN TB2 ELSE LEFT JOIN TB3 
  • Of course no. I know that the result most likely does not suit, but you can: select *, if (cond, tb2.value, tb3.value) from table left join tb2 ... left join tb3 ... Therefore, describe the task, not part . - Yura Ivanov
  • About this and wanted. The thing is that in the system there are 2 types of users, delimited by 2 tables. And depending on UserType , you need to pull data from one of them, because only the id and UserType stored in the table . ___ It would be better if you avoid one hitch with the table. - Jony

1 answer 1

Collect a request for php, based on the conditions.