MySQL Error Code: 1349. View's SELECT contains a subquery in the FROM clause MySQL Error Code: 1349. View's SELECT contains a subquery in the FROM clause database database

MySQL Error Code: 1349. View's SELECT contains a subquery in the FROM clause


MySQL does not support subqueries in views:

Subqueries cannot be used in the FROM clause of a view.

The documentation is here.

The easiest fix is to use a series of different views for each level.

You can probably rewrite this query to remove the subqueries. However, I find it very hard to help without explicit joins.


Version 5.7 supports it. So one way to fix it is to migrate your database to newer version


upgrade to mysql-8 and your problem is solved.