简体   繁体   English

查询中的表名是否应该是Case-SensitIvE?

[英]Are Table names in a Query supposed to be Case-SensitIvE?

Are Table names in a Query supposed to be Case-SensitIvE in MySQL? 查询中的表名是否应该是MySQL中的Case-SensitIvE?

For example, if I do the following: 例如,如果我执行以下操作:

var query = "SELECT something FROM thAt WHERE this = '". $everything ."'";

If the actual table name is all lowercase, and I use a combination of upper and lowercase in my select query, SHOULD it match? 如果实际的表名都是小写的,并且我在select查询中使用大写和小写的组合,那么它应该匹配吗? Is table names in queries supposed to be case-(in)sensitive? 查询中的表名是否应该是大小写(敏感)?

From < Is SQL syntax case sensitive? 来自< SQL语句区分大小写吗? >: >:

Mysql has a configuration option to enable/disable it. Mysql有一个配置选项来启用/禁用它。 Usually case-sensitive table and column names are the default on Linux MySql and case-insensitive used to be the default on Windows, but now the installer asked about this during setup. 通常区分大小写的表和列名称是Linux MySql上的默认值,而不区分大小写曾经是Windows上的默认值,但现在安装程序在安装过程中询问了这一点。 For MSSQL it is a function of the database's collation setting. 对于MSSQL,它是数据库的排序规则设置的函数。

Here is the MySql page about name case-sensitivity: http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html 以下是关于名称区分大小写的MySql页面: http//dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html

Here is the article in MSDN about collations for MSSQL: http://msdn.microsoft.com/en-us/library/ms143503(SQL.90).aspx 以下是MSDN中有关MSSQL排序规则的文章: http//msdn.microsoft.com/en-us/library/ms143503 (SQL.90) .aspx

As per the documentation here , case sensitivity of table names is filesystem-dependent. 根据此处的文档,表名称的区分大小写取决于文件系统。 On Windows, they are case insensitive. 在Windows上,它们不区分大小写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM