I'm trying to get problems with something I think even simple, but I do not know which command I should run to do this.
Well let's go there: I have a table (let's call it FILMES) ... and this table has 3 columns.
What I need:
I need to add all the values in column 2 of this FILMES table and divide by the total number of values. That is, suppose my second column has 3 values: 2, 3 and 4.
I need to add these 3 values and then divide by 3.
It looks like this: (2 + 3 + 4) / 3.
I even know how to get the sum with the cursor in count. But, I do not know how to retrieve the sum (use SUM) as a value that I might be dividing by the total of numbers.
In short, you would need to add only the items in column 2, whose value in column 3 is 0. But I can see that later, if you help me recover the sum of the columns so that I can divide by the total would already be great help.