Since I got the same error type explained in some many other stackoverflow questions:
MySQLSyntaxErrorException: Every derived table must have its own alias
After carefully reading it including every single duplicate question (like this one for example), I have tried to assign for every derived table a specific alias.
This is my example query:
SELECT pl.*, p.cat_1, pb.id
FROM table_1 AS pl
JOIN table_2 AS p ON p.id=pl.column_id
JOIN table_3 AS pb ON pb.id=p.id
JOIN table_4 AS u ON u.id=pl.user_id
WHERE pl.value_1=2 AND pl.value_2 > 0
ORDER BY id desc
Probably I'm doing something wrong, maybe this is not the best way to write the query? I don't know but without any suggestions I can not understand which is the problem, also because the query in concrete works well if it's executed.
Any suggestions?