Issue
The following SQLite query executes successfully when running outside of Designer:
WITH
newname as
(SELECT * from tablename where column_name = 'something')
SELECT * from newname
However, when testing the syntax in the 'SQL Editor' tab of the Visual Query Builder popup, the following error is displayed:
near 'as': syntax error
Environment Details
Cause
The query is being parsed as two separate select statements.
Resolution
Enclose the full SQL statement in parentheses and re-test the query.
e.g.
(
WITH
newname as
(SELECT * from tablename where column_name = 'something')
SELECT * from newname
)
Additional Resources