Hi I have the below table with SQL queries and I am planning to batch run the SQL query after replacing (20220501, 20220509) and ('HYB','CCA','MON','RST') in the SQL query with "Extract dates" and "Product Code" can you please help. Thank you in advance. I am trying to use Regex replace but not able to get the code to identify or let me know if you have any other approach to follow
| Product | Extract dates | Product code | SQL |
| Cloths | 20220612, 20220613 | 'AAB','AAC','AAD','AAE','AAF','AAG' | SELECT AMS_code, PAMS_AQ_ID,DEM_ID SUM(ADC_CCY) AS ADC_AM FROM Table_sales_daily (NOLOCK) WHERE AMS_code IN (20220501, 20220509) AND PAMS_AQ_ID IN ('HYB','CCA','MON','RST') AND DEM_ID = 13 GROUP BY AMS_code, DEM_ID |
| Electronics | 20220612, 20220613 | 'BBA','CCA' | SELECT AMS_code, PAMS_AQ_ID,DEM_ID SUM(ADC_CCY) AS ADC_AM FROM Table_sales_daily (NOLOCK) WHERE AMS_code IN (20220401, 20220406) AND PAMS_AQ_ID IN ('DUS') AND DEM_ID = 13 GROUP BY AMS_code, DEM_ID |
| Books | 20220612, 20220613 | 'CCB','CCD','CCE' | SELECT AMS_code, PAMS_AQ_ID,DEM_ID SUM(ADC_CCY) AS ADC_AM FROM Table_sales_daily (NOLOCK) WHERE AMS_code IN (20220401, 20220406) AND PAMS_AQ_ID IN ('CLA','CCA','MON','RST') AND DEM_ID = 13 GROUP BY AMS_code, DEM_ID |