在MySQL中使用Constraint作为字段名称 [英] Using Constraint as a field name in mysql

查看:184
本文介绍了在MySQL中使用Constraint作为字段名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在使用MySQL作为后端数据库.我正在使用约束作为字段名称.

我有什么方法可以使用它..

Hi All,
I am using MySQL as a backend database. I am using constraint as a field name.

Is there any way i can use it..

推荐答案

通常不要将保留字用作字段名,而不是在.NET,SQL和SQL中,可能没有任何语言.尝试将字段称为约束"的同义词,例如限制"或约束".
如果您真的想使用它,可以通过在字段名周围加上反引号"来工作,例如约束".在SQL2008中,它将与[约束]之类的[括号]一起使用.
It is usually not a good idea to use reserved words as fieldnames, not in .NET, not in SQL and probably not in any language. Try calling the field a synonym for Constraint, such as Limitation or Constriction.
If you really want to use it it might work by putting `backticks` around the fieldname, like this `Constraint`. In SQL2008 it would work with [brackets] like [Constraint].


这篇关于在MySQL中使用Constraint作为字段名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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