0

I have a table like the following and I have used GROUP_CONCAT(val) as LIST_Value. I want to consider the mean of the this column and also the length of the values in each row. This AVG(GROUP_CONCAT(val)) and GROUP_CONCAT(AVG(val)) did not solve that.

I also read this link: MySQL pivot row into dynamic number of columns But, I could not find the answer for my problem.

enter image description here

1 Answers1

0

If you want the average, do it separately from the group concatenation.

SELECT point_id, date, GROUP_CONCAT(val) AS LIST_Value, AVG(val) AS AVG_Value
FROM yourTable
GROUP BY point_id, date
Barmar
  • 741,623
  • 53
  • 500
  • 612