title: Display SQL AVG function value on all rows
body: <p>My oracle table, "invoice" looks like this.</p>
  
  <pre><code>   INV_NUM   CUST_NUM INV_DATE             INV_AMOUNT
  </code></pre>
  
  <hr>
  
  <pre><code>  8000       1000 23-Mar-08                235.89
    8001       1001 23-Mar-08                312.82
    8002       1001 30-Mar-08                 528.1
    8003       1000 12-Apr-08                194.78
    8004       1000 23-Apr-08                619.44
  </code></pre>
  
  <p>I need to write a select query that will diplay the inv_num,inv_amount and the average inv_amount. The expected output is like this.</p>
  
  <pre><code>   INV_NUM   INV_AMOUNT       AVG(INV_AMOUNT)
  </code></pre>
  
  <hr>
  
  <pre><code>  8000       235.89               378.206
    8001       312.82               378.206
    8002       528.1                378.206
    8003       194.78               378.206
    8004       619.44               378.206
  </code></pre>
  
  <p>I want the value from the AVG function to be repeated in every row. I understand that the AVG function returns only a single row. I get an error when I try this query.</p>
  
  <pre><code>select inv_num,inv_amount,avg(inv_amount) from invoice;
  
  ERROR at line 1: ORA-00937: not a single-group group function
  </code></pre>
  
  <p>Is there a way to get the avg value to be displayed in every row? I need some help figuring this out. Thanks. </p>