Re: [druid-user] With tablename as queries: Multiple With tables

Try this (remove the second ‘WITH’ and add a comma after the first subquery):

WITH t1 as
(select column1, count() as “COUNT”
from table
WHERE column1 = ‘x’
GROUP BY 1
order by “COUNT” desc),
t2 as
(SELECT column1, count(
) as “COUNT_total”
from table
GROUP BY 1)
select “COUNT”, “COUNT_total”
from t1, t2