can't run CTEs in query console
Answered
Whenever I tried to run a query with CTEs (subqueries), PyCharm always run it in separate statements (even I selected the whole script to run)... Sample query:
```
WITH a AS (
SELECT *
FROM TABLE
)
SELECT COUNT(*)
FROM a;
```
and it always ran in two statements and of course both failed.
Is this not supported or is there a tool can help?
Any help would be appreciated, thanks!
Please sign in to leave a comment.
what is your DBMS?
let's try this - go to File | Settings | Tools | Database -> set 'For selection execute' to 'Exactly as one statement' and check again.
it works, thank you Yuriy!