Translation: Identifier Qualifiers,

Source: Internet
Author: User

Translation: Identifier Qualifiers,

This article is the translation of Identifier Qualifiers, an official mariadb manual.

Original article: https://mariadb.com/kb/en/library/identifier-qualifiers/
Https://mariadb.com/kb/zh-cn/library/identifier-qualifiers/ I submitted to the MariaDB official manual

Identifier Qualifiers

SQL statements use a qualifier to reference data structures, such as databases, tables, and fields. For example, a SELECT query contains some fields and at least one table.

A qualifier can be composed of one or more identifiers names. All content starting from its first character to its ending character will be parsed:

  • For a database, you only need to specify an identifier for the database name.
  • You can specify an identifier for objects (such as tables, views, and functions) in a database. If no DATABASE name is specified, the current DATABASE is used (for details, see USE and DATABASE ()). If no default database exists and no database is specified, an error is returned.
  • For field names, you can clearly know the table and database names from the context of the statement. However, you can also specify the table identifier or add the database identifier. If a qualifier is composed of more than one identifier, it must be separated by a dot. All identifiers can be enclosed in quotation marks. An extra space (or a new line or tab) is allowed between the delimiters ).

The following examples are correct and valid:

  • Db_name.tbl_name.col_name
  • Tbl_name
  • 'Db _ name'. 'tbl _ name'. 'col _ name'
  • 'Db _ name'. 'tbl _ name'
  • Db_name. tbl_name

If the table identifier has a prefix (.), the default database is used. This syntax is used to comply with ODBC, but it has no practical effect in MariaDB. The following delimiters are equivalent:

  • Tbl_name
  • . Tbl_name
  • . 'Tbl _ name'
  • . 'Tbl _ name'

Starting from MariaDB 10.0, the DML statement can use the PARTITION clause to specify the PARTITION list. For more information, see Partition Pruning and Selection.

 

Go back to the Linux series article outline: workshop!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.