Skip to content
Advertisement

Format pivot data with multiple conditions

My current query is

Right now, the output it displays is of the form:

users | date | event |
3 | 2019-09-25 | visit |
4 | 2019-09-25 | click_button |
10 | 2019-09-25 | visit |

I want it to be of the form

| date | users_visits | users_clicks |
|2019-09-25 | 3 | 4 |
|2019-09-26 | 10 | 0 |

I wrote this query but it does not work, I don’t understand really how to get the counting query inside the pivoting query properly

Advertisement

Answer

Does conditional aggregation work?

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement