gpt4 book ai didi

mysql - 如何更新以 SQL 中的日期命名的列名

转载 作者:行者123 更新时间:2023-11-28 23:42:38 27 4
gpt4 key购买 nike

UPDATE studentattendance
JOIN studentdetails using(matricno)
JOIN studentModules using (matricno)
SET 05/12/15 = 1
WHERE cardUid = '01545695'

嘿,进展如何,我在更新数据库中的列时遇到问题,该列名为“05/12/15”,因为它是以日期命名的。但是,由于语法错误,我无法使用 SQL 对其进行更新。

我该如何更新它,因为它似乎在使用正斜杠时遇到问题。我试过单引号和方括号,但它们不起作用

谢谢

最佳答案

使用 反引号 允许您使用替代字符。

SET `05/12/15` = 1

查询:-

UPDATE studentattendance
JOIN studentdetails using(matricno)
JOIN studentModules using (matricno)
SET `05/12/15` = 1
WHERE cardUid = '01545695'

关于mysql - 如何更新以 SQL 中的日期命名的列名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34100889/

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