我正在尝试将 3 个表连接在一起,但我在字段列表中不断收到“未知表”调用。我知道表'调用'存在
这有效...
$sql = "SELECT * FROM calls WHERE id = '$diary_id'";
但这并不...
$sql = "SELECT * FROM (SELECT calls.id AS calls_id, calls.assigned_user_id AS assigned_user) calls
RIGHT JOIN accounts on accounts.parent_id = accounts.id
LEFT JOIN users on assigned_user = user.id
WHERE calls_id = '$diary_id'";
我正在尝试使用别名,因为我尝试加入的表具有相同的字段名称(我必须使用继承的数据库)。
任何帮助将不胜感激