SQL单词组作为列名 [英] SQL word group as column name

查看:85
本文介绍了SQL单词组作为列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是基本命令

UPDATE UserProfile SET Group='3' WHERE UserId='15';

但是group是保留字,所以不起作用,I发现我应该使用上面的

but group is a reserved word so doesnt work, I find that I should use

`

,但也不行。我怎么解决这个问题? :)

above group but also doesnt works. How can I solve this ? :)

推荐答案

尝试:

Try:
UPDATE UserProfile SET [Group]='3' WHERE UserId='15';


如果您使用的是MS SQL Server / MS Access,请写:

If you are using MS SQL Server/MS Access write :
...set [Group] = ...



如果您使用的是MySql,请写:


If you are using MySql write :

...set `Group` = ...



如果您使用的是Sqlite,请写:


If you are using Sqlite write :

...set "Group" = ...


这篇关于SQL单词组作为列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆