title: Oracle SQL: Use sequence in insert with Select Statement
body: <p>Basically I want to run the following query:</p>
  
  <pre><code>INSERT INTO historical_car_stats (historical_car_stats_id, year, month, make, model, region, avg_msrp, count)
    SELECT
      my_seq.nextval,
      '2010',
      '12',
      'ALL',
      'ALL',
      region,
      sum(avg_msrp * count) / sum(count),
      sum(count)
    FROM historical_car_stats
    WHERE year = '2010'
          AND month = '12'
          AND make != 'ALL'
    GROUP BY region;
  </code></pre>
  
  <p>It doesn't work because "sequence number not allowed here" SQL error.  How can I write this so Oracle will let me do what I want to do?</p>