mysql中把一个查询结果插入到另外一个表中
[quote]
insert into best_quote( quote_id, product_id, quote_type, quote_price, quote_amount, quote_time, company_id )
select quote_id, product_id, quote_type, quote_price, quote_amount, quote_time, company_id
from quote
where product_id = 4
and quote_type = 1;
[/quote]
[quote]
insert into best_quote( quote_id, product_id, quote_type, quote_price, quote_amount, quote_time, company_id )
select quote_id, product_id, quote_type, quote_price, quote_amount, quote_time, company_id
from quote
where product_id = 4
and quote_type = 1;
[/quote]
本文介绍了一种使用MySQL的查询结果进行表间数据迁移的方法。通过一个具体的SQL语句示例,展示了如何将满足特定条件的数据从一个表转移到另一个表中。这种方法在数据同步和更新场景下非常实用。
2890

被折叠的 条评论
为什么被折叠?



