When I use nested CTE's I get a syntax error in SQLiteStudio (version 3.4.3). When I run the same query on the SQLite command line, it works without any issues ...
Results that may be inaccessible to you are currently showing.
Hide inaccessible results