gpt4 book ai didi

php - MySQL:克隆一张表中的行

转载 作者:行者123 更新时间:2023-11-29 17:14:28 24 4
gpt4 key购买 nike

我有一张包含下一个内容的表格

stat_id|stat_type|stat_value
1 |likes |100
1 |reposts |150

是否可以将这些行克隆为另一个 stat_id位于一个查询中?

重要的是我们需要几个新的 stat_id 的副本.

最佳答案

使用INSERT ... SELECT

insert into your_table (c1, c2, ...)
select c1, c2, ...
from your_table
where id = 1

关于php - MySQL:克隆一张表中的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51708570/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com