gpt4 book ai didi

mysql - 如何在 MySQL 中将数据从一个表移动到另一个表?

转载 作者:太空宇宙 更新时间:2023-11-03 11:03:28 26 4
gpt4 key购买 nike

我有以下查询提取 1000 行数据:

select barcode, type from collections where user = 'myusername'

我需要将这些数据移动到我的新 collectors_collections 表中。 user 列现在标记为 username

最快的方法是什么?某种或其他方式的查询?我正在使用最新的 MySQL Workbench。

最佳答案

您可以尝试运行此查询:

INSERT INTO
collectors_collections(barcode, type, username)
SELECT
barcode,
type,
`user`
FROM
collections
WHERE
`user` = 'myusername';

关于mysql - 如何在 MySQL 中将数据从一个表移动到另一个表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13865749/

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