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!

0
2 comments
Avatar
Yuriy Vinogradov

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.

1
Avatar
Permanently deleted user

it works, thank you Yuriy!

0

Please sign in to leave a comment.