I am working on a table in a MySQL database which has 3 columns which are following,
event_name campaign_name customer_id
event_1 campaign_1 1
event_2 campaign_1 1
event_1 campaign_1 1
event_2 campaign_1 1
event_2 campaign_1 2
I want to query unique and total count of customer_id for each combination of event_name and campaign_name in the following format,
campaign_name event_1_unique_count event_1_total_count event_2_unique_count event_2_total_count
campaign_1 1 2 2 2
Number of event names can be different that's why i am looking for a generic solution. Thanks.