How to get data for the past x weeks for each type?
问题 I have below query which gives me data with three columns - type , amount and total for previous week using week_number column. select type, case WHEN (type = 'PROC1' AND contractdomicilecode = 'UIT') THEN 450 WHEN (type = 'PROC1' AND contractdomicilecode = 'KJH') THEN 900 WHEN (type = 'PROC2' AND contractdomicilecode = 'LOP') THEN 8840 WHEN (type = 'PROC2' AND contractdomicilecode = 'AWE') THEN 1490 WHEN (type = 'PROC3' AND contractdomicilecode = 'MNH') THEN 1600 WHEN (type = 'PROC3' AND