基本上我想运行以下查询:
@H_404_6@INSERT INTO historical_car_stats (historical_car_stats_id,year,month,make,model,region,avg_msrp,count) SELECT my_seq.nextval,'2010','12','ALL',sum(avg_msrp * count) / sum(count),sum(count) FROM historical_car_stats WHERE year = '2010' AND month = '12' AND make != 'ALL' GROUP BY region;