gpt4 book ai didi

mysql - 根据列值替换列值

转载 作者:行者123 更新时间:2023-11-29 07:35:43 25 4
gpt4 key购买 nike

我有一个巨大的 tabledb,有 160 万个条目。我要更换

SELECT `Type` FROM `my_db` WHERE `Type` != "a" AND `Type` != "b" AND `Type` != "c"

上面的查询给出了接近 7K 行。

我想通过上述查询更新所有选定的行,以便将 Type 重新分配给值 "a"

我该怎么做?

最佳答案

您将使用更新:

update mydb
set type = 'a'
where type not in ('a', 'b', 'c');

关于mysql - 根据列值替换列值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30890240/

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