clickhouse-mysql-data-reader icon indicating copy to clipboard operation
clickhouse-mysql-data-reader copied to clipboard

Select query with multiple joins won't work

Open ericchuawc opened this issue 5 years ago • 1 comments

I need some help.

I have managed to migrate some of MySQL 5.1 tables to Clickhouse.

Basic select query works fine with 1 inner join.

However I noticed if I have more than 1 join e.g.

select from table1 inner join table2 on table1.a = table2.a inner join table3 ... (more joins left join or inner joins)

This won't work in ClickHouse (it works in MySQL)

Do you have any recommendations how to rewrite this query inside ClickHouse? Otherwise what is the best approach to do this?

Thanks.

ericchuawc avatar May 27 '20 01:05 ericchuawc

Yes. With sub-queries with good WHERE and/or HAVING statements most probably.

sv3t0sl4v avatar Jan 19 '21 12:01 sv3t0sl4v