测试都是在world数据库下进行.
1.
select * from country;
select * from world.country;
2.
select name from country;
select country.name from country;
select world.country.name from country;
3.使用存储过程
db_name.routine_name
4.使用触发器
table_name.trigger_name
5.
To use quoted identifiers in a qualified name, quote them separately. For example, quote world.Country as `world`.`Country`, not as `world.Country`.
为了在一个限定名称中使用被单引号引用的标识符,那么就必须分别用单引号引用它们.
例如:用单引号(')引用world.country正确的方法是:'world'.'country',而不是'world.country'
6.使用mysql的保留字作为标识符
create table t(order int not null unique,d date not null);
--order是order by从句的保留字,所以在创建该表时将失败
select 1 as INTEGER;
--INTEGER是MYSQL数据库的保留字,所以在查询时将失败
那么我们如何使用MYSQL数据库中的保留字?
要使用MYSQL数据库中的保留字作为数据库,表,列或索引的标识符,这里有一种或两种允许引用的样式,这取决于MYSQL服务器上的SQL模式。默认情况下,反引号('`')内(即:被反引号包围的字符)的字符允许它被用作一个标识符.如下:
create table t(`order` int not null unique,d date not null);
如果数据库的ANSI_QUOTES的SQL模式被激活,它也允许使用双引号(")引用保留字,如下:
create table t2("order" int not null unique,d date not null);
要使用一个保留字作为别名,使用单引号,双引号,或反引号引用都可以.SQL模式没有什么区别;使用三种引用中的任意一种都是合法的。
select 1 as 'INTEGER';
select 1 as "INTEGER";
select 1 as `INTEGER`;
MYSQL数据库中的保留字(关键字)和函数名称(mysql系统函数和用户自定义函数)是不区分大小写的.他们可以是大写,小写,甚至混合的情况下,不需要写成同样的方式在整个查询过程中.
分享到:
相关推荐
前端开源库-sanctuary-type-identifiers保护区类型标识符,类型标识符规范
Laravel开发-laravel-view-identifiers 在Laravel5中将全局类和全局ID设置为主HTML DOM元素的快速方法。
安装npm install undeclared-identifiers用法var undeclaredIdentifiers = require ( 'undeclared-identifiers' )undeclaredIdentifiers ( src )// { identifiers: ['Buffer'],// properties: ['Buffer.isBuffer'] }...
您可以使用可执行文件,但在快速测试之外它并没有真正有用。 $ ./bin/shift-identifiers jquery.js /bin/shift-identifiers vendor/jquery/dist/jquery.js { selector: [ 'toSelector', 'select', 'selectors', '...
Woocommerce其他产品标识符这个小辅助插件将缺少的产品标识符添加到Woocommerce产品中。 它将在销售渠道所需的简单和可变...插件目录名为“ woocommerce-additional-product-identifiers-master”从名称中删除-maste
bhl-us-identifiers:BHL中包含的每个项目的Internet存档标识符的当前列表
nosql.put("/identifiers/florent", 10) nosql.put("/identifiers/kevin", 12) The data structure will be / ---users/ ---"florent" ---"kevin" ---identifiers/ ---florent/ ---10 ---kevin/ ---12 It'l
设置Android设置将android.permission.NFC添加到您的NFC中以使用Flutter一个Flutter插件来管理NFC功能。 在Android和iOS上均受支持。 设置Android设置将android.permission.NFC添加到您的AndroidMenifest.xml中。 ...
PG2MySQL转换器命令行用法(推荐) PGPASSWORD=yourpass pg_dump -h localhost --quote-all-identifiers \ --no-acl --no-owner --format p --data-only dbname -f pgfile.sql pg_dump其他文档在...
ToIP WP0035:分散式资源标识符 作者: ·惠特玛( ,罗伯特·米特威基(Robert Mitwicki),戴夫·麦凯(Dave McKay),朱文静,狄安·罗斯(Dian Ross) 状态:已 因为:2021-03-18 状态说明:白皮书被批准为EFWG...
SID也就是安全标识符(Security Identifiers),是标识用户、组和计算机帐户的唯一的号码。在第一次创建该帐户时,将给网络上的每一个帐户发布一个唯一的 SID。Windows 2000 中的内部进程将引用帐户的 SID 而不是...
ESLint插件,允许您使用特定于项目的规则,类似于命令行选项()。 (以前为 )的解决方法。 其他解决方案 允许自定义规则目录名称 依存关系 需要ESLint 0.8.0或更高版本 安装 npm install eslint-plugin-local-...
MySQL Replication enables users to cost - effecti ...demonstrates how to do this using Global Transaction Identifiers (GTIDs) as well as the extra steps needed when taking the more traditional approach.
MySQL Certification Study Guide is the official guide to studying for and passing the two MySQL certification tests for MySQL 5. Written by Paul DuBois, the leading author of books on MySQL topics, ...
ISO 20302-2022 Health informatics - Health cards - Numbering system and registration procedure for issuer identifiers.pdf
名称----说明 cgnscheck----- a CGNS file validator cgnscompress----- compress (remove extra space) from a CGNS file cgnsdiff------ compare 2 CGNS files cgnslist---- list the contents of a CGNS file ...
The new edition covers MySQL 5.0 and its powerful new ... Generate sequence numbers to use as unique row identifiers Create database events that execute according to a schedule And a lot more
ONU management and control interface (OMCI) specification
Identifiers.org是一个以URI形式提供可解析和持久性标识符的系统,用于标识科学界的数据,当前重点是生命科学领域。 可解析标识符(URL)的提供与语义Web愿景和“链接数据”计划非常吻合。 Identifiers.org的解析...
/* LENGTH OF IDENTIFIERS */ const NORW = 14; /* # OF RESERVED WORDS */ const TXMAX = 100; /* LENGTH OF IDENTIFIER TABLE */ const NMAX = 14; /* MAX NUMBER OF DEGITS IN NUMBERS */ const AMAX =2047; /* ...