I have 161 columns, and each column has over 50k data. I have to show this information for each column in a line graph. If you try to show this information in a line graph, it will take longer to draw the graph.
Problem:
Now I decided to split the data corresponding to each column. As for column1, the first 50 rows take an average value, then take seconds 50 rows and so on. This process will continue for all columns.
How can I do this in SQL. I did this in C #, but I want to do it at the end of the SQL server.
public static IEnumerable<double> CheckRateValue(this IEnumerable<double> values) { int i = 1; int j = 0; for (; i < values.Count(); ) { yield return values.Skip(j * 2).Take(2).Average(); i = i + 2; j++; } }
source share