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.