search from several tables in one query

21 views
Skip to first unread message

Xeno Amess

unread,
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

unread,
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 <xeno...@gmail.com> 于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 clickhouse+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clickhouse/f2a9ee82-5db8-4987-9b1b-ce6522fea500n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages