title: Average certain values ​in Mysql
body: <p>I have a table and a line where I return values ​​from a table</p>
  <p><img src="https://i.stack.imgur.com/sWPlX.png" alt="1" /></p>
  <pre><code>select ROUND(avg(corrente/1000*tensao*fpot/100/1000),2) as consumo,HOUR( hatual )as hora,date( hatual )as data 
  from logsuc 
  where nserlum=2009004991 
  and date(hatual)&gt;=&quot;2021-05-01&quot; 
  and date(hatual)&lt;=&quot;2021-05-12&quot; 
  and corrente!=0 
  group by hora,data;
  </code></pre>
  <p>this line returns the average for a piece and works very well as we can see in the image</p>
  <p><img src="https://i.stack.imgur.com/tBnhN.png" alt="2" /></p>
  <p>but the problem comes when I need to do this for more than one piece all together on the same table</p>
  <pre><code>select ROUND(avg(corrente/1000*tensao*fpot/100/1000),2) as consumo,HOUR( hatual )as hora,date( hatual )as data 
  from logsuc 
  where ( nserlum=2009004986 or nserlum=2009004987) 
  and date(hatual)&gt;=&quot;2021-05-12&quot; 
  and date(hatual)&lt;=&quot;2021-05-13&quot; 
  and corrente!=0 
  group by hora,data;
  </code></pre>
  <p>he does the average but will continue to give a value around 0.10 and not a value 0.20 I need something that makes the averages per hour of two pieces add up to two of that hour giving then 0.20 but I don't know how to do that. Is there any way to do this? thanks</p>