Clickhouse: Correlated subqueries

Created on 28 Aug 2019  Â·  3Comments  Â·  Source: ClickHouse/ClickHouse

I want use the follow sql query,it's not work, I use msyql execute it's ok. can ck is support?

(SELECT A1.QTY_SOLD  FROM V_LB_DC_ITEM_CUST_MONTH A1 WHERE A1.CUST_ID=A.CUST_ID LIMIT 1) AS TQ_QTY_SOLD,
A.QTY_SOLD
FROM V_LB_DC_ITEM_CUST_MONTH A

image

feature sql-compatibility st-hold

Most helpful comment

Correlated subqueries are not supported, and currently no schedule for implementing that.

You can rewrite your query using JOIN.

P.S. We still have no issue to track requests for that feature. Let's use this one.

Eager to have these functions ,

All 3 comments

Correlated subqueries are not supported, and currently no schedule for implementing that.

You can rewrite your query using JOIN.

P.S. We still have no issue to track requests for that feature. Let's use this one.

Correlated subqueries are not supported, and currently no schedule for implementing that.

You can rewrite your query using JOIN.

P.S. We still have no issue to track requests for that feature. Let's use this one.

Eager to have these functions ,

Simple samples from #9861

SELECT dummy, name
FROM system.one, system.columns
WHERE (SELECT count() FROM system.columns WHERE name != '' AND dummy = 0) > 0
LIMIT 1;

# fail
SELECT o.dummy, name
FROM system.one o, system.columns
WHERE (SELECT count() FROM system.columns WHERE name != '' AND o.dummy = 0) > 0
LIMIT 1;
Was this page helpful?
0 / 5 - 0 ratings