I’m trying to sum some fields of a same row, not column, a row.
how could I do this in yii 2 ?
this is a view of my table evaluation
ID idpro idclass idprof idstud userd p1 p2 p3 p4 p5 p6 p7 p8 p9 average
14 2 6 10 35 can 10 8 0 0 0 0 2 0 5 NULL
I need to sum the values between column P1 and P9 and make the average of the sum. But the average must be calculated considering only the values greater than zero.