Amazon Redshift - Get week wise sales count by category
问题 I have daily sales data as below. I am trying to group by sales week wise. I tried using group by that gives total count for the period, how could I modify the query to obtain an output as shown below: Expected output: Last N days,Count,Category Last 7 days,225,Category_1 Last 14 days,136,Category_2 Last 7 days,172,Category_1 Last 14 days,321,Category_2 Input data: Date,*Sales*,Category 01-06-2018,10,Category_1 01-06-2018,19,Category_1 03-06-2018,3,Category_1 04-06-2018,13,Category_1 05-06