red-soft-ru / shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Apache License 2.0
0 stars 1 forks source link

T122 WITH (excluding RECURSIVE) in subquery #58

Open TedCraft opened 5 months ago

TedCraft commented 5 months ago

You have an error in your SQL syntax: SELECT C.CUST_NAME C.CUST_CITY FROM CUSTOMER c WHERE c.agent_code in (WITH T121 AS (SELECT AGENT_CODE FROM AGENTS) SELECT C.CUST_NAME FROM CUSTOMER c LEFT JOIN T121 T ON T.AGENT_CODE = C.AGENT_CODE) no viable alternative at input 'in' at line 1 position 68 near @1568:69='in'<106>1:68

TedCraft commented 5 months ago

SELECT C.CUST_NAME, C.CUST_CITY FROM CUSTOMER c WHERE c.agent_code in (WITH T121 AS (SELECT AGENT_CODE FROM AGENTS) SELECT C.CUST_NAME FROM CUSTOMER c LEFT JOIN T121 T ON T.AGENT_CODE = C.AGENT_CODE)

makssent commented 4 months ago