How can I use python to execute the proceeding select statement for an individual short_ID (Short_ID is a field name from the table in the image I posted).
SELECT FORMAT(SUM( IIF (Status = 'Completed', 1 , 0)) / COUNT (Status), 'percent' ) AS completion_metric FROM PROMIS_LT_Long_ID;
My issue is that the same short_ID shows up several times in the PROMIS_LT_Long_ID table. I need to execute the select statement only for records with the same Short_ID. I was thinking of using a for loop with an if statement inside like:
for record in PROMIS_LT_Long_ID: for record1 in PROMIS_LT_Long_ID: if record = record1: #execute the select statement
Aucun commentaire:
Enregistrer un commentaire