diff --git a/scripts/tracker-procs/03-gc-report-proc.sql b/scripts/tracker-procs/03-gc-report-proc.sql index eb68de4..7824d70 100644 --- a/scripts/tracker-procs/03-gc-report-proc.sql +++ b/scripts/tracker-procs/03-gc-report-proc.sql @@ -126,9 +126,9 @@ BEGIN gc_case.variation_id, gc_case.lab_id as submitter_id, gc_case.case_report_key, - STRING_AGG(DISTINCT FORMAT("%%s.%%i", lab_scv.id, lab_scv.version)) as acxn, - STRING_AGG(DISTINCT lab_scv.classif_type) as classif_type, - STRING_AGG(DISTINCT lab_scv.submitted_classification) as classification, + STRING_AGG(DISTINCT FORMAT("%%s.%%i", lab_scv.id, lab_scv.version) ORDER BY lab_scv.id, lab_scv.version) as acxn, + STRING_AGG(DISTINCT lab_scv.classif_type ORDER BY lab_scv.classif_type) as classif_type, + STRING_AGG(DISTINCT lab_scv.submitted_classification ORDER BY lab_scv.submitted_classification) as classification, MIN(lab_scv.last_evaluated) as last_evaluated, MIN(lab_scv.date_created) as first_in_clinvar, COUNT(DISTINCT lab_scv.id) as scv_count