search from several tables in one query

Skip to first unread message

Xeno Amess

Mar 19, 2022, 2:37:17 AMMar 19
to ClickHouse
Hi guys.
I need to search from several tables in one query, is there any way to achieve this?
I tried
select name from merge('system', 'collations|databases')
it works, but 
select * from merge('system', 'collations|databases')
would fail.
Yep my situation is kindof like select *.
I need to get all columns from both tables, and the columns are slightly different in each table.
I with to get a result that:
1. it contains all datas who can pass the filter.
2. for columns not on this table, it would just put value NULL, or missing this column.
Is there any suggestions?
Thanks a lot!

Xeno Amess

Mar 19, 2022, 2:41:44 AMMar 19
to ClickHouse
the reason why we want this is we are migrating from ES to ClickHouse, and the original ES codes have such utility to search from several indexes, and the boss thinks it would be better not to change the UI.

Xeno Amess <> 于2022年3月19日周六 14:37写道:
You received this message because you are subscribed to the Google Groups "ClickHouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages