MySQL Forums
Forum List  »  Spanish

Re: Procedumiento
Posted by: Peter Brawley
Date: January 06, 2021 12:11AM

No es eficiente --- por decirlo suavemente. Dada una tabla con columnas c1, c2, ..., cn almacenando si / no respuestas, recolecta los valores con sql como ...

select 
  case when c1='si' then 1 when 'no' then 0 else null end as c1,
  case when c2='si' then 1 when 'no' then 0 else null end as c2, 
  ..., 
  case when cn='si' then 1 when 'no' then 0 else null end as cn,
from ...

... luego tabular con la agregación de la lógica SQL (suma ... agrupar por)

Options: ReplyQuote


Subject
Views
Written By
Posted
522
January 05, 2021 09:58PM
Re: Procedumiento
182
January 06, 2021 12:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.