gpt4 book ai didi

sql - 使用多个 SET 参数更新表

转载 作者:行者123 更新时间:2023-12-01 19:48:19 24 4
gpt4 key购买 nike

<分区>

我收到了一份要对表格进行更改的列表。我想知道如何在一个脚本中进行所有更改......我尝试了以下操作

UPDATE tableA
SET col1 = 'somedata' WHERE col2 = 'somereference'
SET col1 = 'someotherdata' WHERE col2 = 'someotherreference'
SET col1 = 'evenmoredata' WHERE col2 = 'anotherreference'

但这行不通。我可以使用特定的语法来实现这一点,还是我坚持这样做:-

UPDATE tableA
SET col1 = 'somedata' WHERE col2 = 'somereference'

UPDATE tableA
SET col1 = 'someotherdata' WHERE col2 = 'someotherreference'

对于我想要进行的每项更改?

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