MySQL中重音(AKA反引号)引号字符的含义是什么? [英] What is the meaning of grave accent (AKA backtick) quoted characters in MySQL?

查看:141
本文介绍了MySQL中重音(AKA反引号)引号字符的含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为什么某些教程和其他MySQL管理工具在其查询中使用重音符号(`),如下所示:

I was wondering why some tutorials and other MySQL management tools use grave accent (`) in their queries like this one below:

SELECT `TableA`.`FieldA`, `TableA`.`FieldB`, `TableA`.`FieldC` 
FROM `Databasename`.`TableA`

当它在下面的查询中显示相同的结果时:

When it displays the same result with this query below:

SELECT FieldA, FieldB, FieldC
FROM TableA

推荐答案

坟墓通常被称为反勾号",MySQL用来逃避

The grave is more commonly referred to as a "backtick", which MySQL uses to escape MySQL reserved words.

在PHPMyAdmin和各种示例中,将所有内容都包装在反引号中是很常见的,因为大多数人宁愿使用任意名称命名表和列,而不必担心命名错误.我个人不同意这种做法...

Wrapping everything in backticks is very common in PHPMyAdmin and various examples because most would rather name tables and columns whatever they like without worrying about naming errors. I don't agree with the practice personally...

这篇关于MySQL中重音(AKA反引号)引号字符的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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