Suppose we have data something like this:
date | campaign | raw | unq
------------+----------+-----+-----
2016-06-01 | camp1 | 5 | 1
2016-06-01 | camp2 | 10 | 1
2016-06-01 | camp3 | 15 | 2
2016-06-02 | camp4 | 5 | 3
2016-06-02 | camp1 | 5 | 1
I need to group it in such a way as to obtain the following result:
date | campaigns | raw | unq
------------+---------------------+----- +-----
2016-06-01 | camp1, camp2, camp3 | 30 | 4
2016-06-02 | camp4, camp1 | 10 | 4
Mysql for these purposes has a function GROUP_CONCAT. Vertica also supports GROUP_CONCAT but I cannot make proper query due to the OVER clause and mandatory partitioning