This message was deleted.
# general
s
This message was deleted.
b
GROUP BY has different limitation depending on how it's done. See this doc section. I suggest playing with it a bit to understand better. For a "taable-level" query you can use column aliasing, but you can't GROUP BY. For "table level" you can GROUP BY, but you can't use column aliasing.
p
Hey @Ben Krug, thanks for this doc, I was wondering it there is a workaround for these limitations in druid without using some other query engine?
b
I tried to mock this up with datasets I had handy. You might be able to using common table expressions (CTEs). Eg, for my datasets:
Copy code
WITH table1 (myTime, event, myCount) AS 
(select __time, cityName, count(*) FILTER (WHERE cityName = 'Aachen') from "wikipedia" 
where cityName = 'Aachen' 
group by 1,2
--having cityName = 'Aachen'
)
,
table2 (myTime, event, myCount) AS (select 'allTime', d3_email, count(*) from dataTest group by 1,2)
select * from table1
union all 
select * from table2
(I didn't seem to need the HAVING clause.)
But I think you probably need that dummy value for the missing column in the one query.