gavinbaumanis
12/06/2022, 10:34 AMwebsolete
12/06/2022, 1:35 PMSELECT questionnaireId,
(CASE WHEN questionnaireId = 1 THEN question_1 ELSE NULL END) AS question_1,
(CASE WHEN questionnaireId = 2 THEN question_2 ELSE NULL END) AS question_2,
(CASE WHEN questionnaireId = 3 THEN question_3 ELSE NULL END) AS question_3,
(CASE WHEN questionnaireId = 4 THEN question_4 ELSE NULL END) AS question_4
FROM tablename
WHERE customerId = 123 AND other_criteriawebsolete
12/06/2022, 1:37 PMMatt Jones
12/06/2022, 2:56 PMcfsimplicity
12/06/2022, 4:02 PMgavinbaumanis
12/07/2022, 11:47 PMq1 = QueryNew( "Q1,Q2", "VarChar,VarChar", [ [ "yes", "yes" ] ] );
q2 = QueryNew( "Q1,Q3", "VarChar,VarChar", [ [ "yes", "yes" ] ] );
q3 = QueryNew( "Q1,Q4", "VarChar,VarChar", [ [ "yes", "yes" ] ] );
And with more some looping / matching on the all-combined columnList, I could build the UNION portions?Matt Jones
12/08/2022, 4:25 PMgavinbaumanis
12/09/2022, 12:55 AM