0
SELECT * FROM (`expenditures`)
JOIN `categories`
ON `categories`.`cat_id` = `expenditures`.`cat_id` IF(`projects`.`project_id` ! = 0)
JOIN `projects`
ON `projects`.`project_id` = `expenditures`.`project_id`
WHERE `expenditure_id` = $expenditure_id
的可能的複製[如何使用IF語句一個MySQL連接查詢?](http://stackoverflow.com/questions/10064183/how-do-i-use-an-if-statement-in-an-mysql-join-query) –
不,這是不可能的。你究竟想要完成什麼? – shmosel