Home > Database > Mysql Tutorial > body text

MySQL extensions to standard SQL

PHPz
Release: 2023-09-09 10:13:02
forward
1012 people have browsed it

MySQL 对标准 SQL 的扩展

#MySQL Server supports extensions that may not be found in other SQL databases. This means that if these extensions to MySQL are used, the code cannot be ported to other SQL servers. But sometimes, it's portable.

Let's understand MySQL's extensions to standard SQL -

String contains

Strings can be enclosed by " (double quotes) or ' (single quotes) by default. If "ANSI_QUOTES" SQL mode is turned on, the string must be enclosed in ', if " (double quotes) are used, the server will interpret it as an identifier.

Escape characters

\ is the escape character for strings.
Copy after login

Accessing tables

MySQL does not support table spaces, that is, using the database name and table name (such as "database_name.table_name") to access the table.

Query h2>

When using the "group by" clause to select all selected columns, you do not need to specify a name for them. This ensures better performance on certain queries.

clause

The "ORDER BY" clause cannot be specified with the "GROUP BY" clause, but "ASC" and "DESC" can be specified with the "GROUP BY" clause.

Operators

The '||' and '&&' operators can be used to indicate logical 'OR' and 'AND' operations respectively when using MySQL server. This is because, '|| " are synonymous with "OR", "&&" and "AND".

Connection

MySQL server does not support the standard SQL operator "|". |' connection string. To do this, The "CONCAT" function can be used.

The above is the detailed content of MySQL extensions to standard SQL. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!