sql 执行select 可以使用的但是加了insert 会lock 怎么办?
INSERT INTO db_amazon_V10_statistics.tb_monthly_sales_statistics (seller_id, record_date, mean_sales, std_sales, mean_revenue, std_revenue)
SELECT
seller_id,
record_date,
AVG(sales) AS mean_sales,
STDDEV(sales) AS std_sales,
AVG(revenue) AS mean_revenue,
STDDEV(revenue) AS std_revenue
FROM
db_amazon_V10.tb_product_month
where seller_id = "A00038802J7X43YTW44TD" and record_date = "2024-04-01"
ON DUPLICATE KEY UPDATE
mean_sales = VALUES(mean_sales),
std_sales = VALUES(std_sales),
mean_revenue = VALUES(mean_revenue),
std_revenue = VALUES(std_revenue);