Data Analysis Programming from SQL to SPL: Access Duration
The following is part of the data from the simplified account table ‘user’ and access table ‘view’: user: view: Download test data 1. Calculate the number of minutes each account spent accessing each product Group by account id and product, and then aggregate the number of minutes of each group. The results contain the columns account id, product and number of minutes. We want to pivot the results to the following format: account id, product A minutes, product B minutes, product C minutes, and so on. SQL code: In SQL, you need to define separate aggregations for each product. Since
...