MySQL-Operando debe contener 1 columna

votos
0

Estoy tratando de hacer la siguiente consulta:

SELECT audits.*,
         GROUP_CONCAT(CONCAT(case
            WHEN now() > str_to_date(EndDate,'%Y-%m-%d') AND Grade is Null THEN 'Expired'
            WHEN now() > str_to_date(EndDate,'%Y-%m-%d') AND Grade != '' THEN 'Submitted'
            WHEN str_to_date(StartDate,'%Y-%m-%d') > now() THEN 'Pending'
            WHEN now() between str_to_date(StartDate,'%Y-%m-%d') AND str_to_date(EndDate,'%Y-%m-%d') THEN'Capturable'
        end)ORDER BY id_Audit) as AuditsStatus,
        (SELECT  aq.id_Area,group_concat(q.id_Question) as questions from fsa_questions as q
        inner join fsa_areasquestions as aq
        on aq.id_Question = q.id_Question
        where aq.id_Area = audits.id_Area  and q.Status = true) as questions
        FROM helios.fsa_audits as audits
        WHERE id_Audit='4';


Pero cuando lo ejecuto me da su error:
ERROR 1241 (21000): Operando debe contener 1 columna (s)
¿Hay otra manera de hacerlo?

Publicado el 09/10/2019 a las 19:02
fuente por usuario
En otros idiomas...                            

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more