Introduction to MySQL statement comments

Introduction to MySQL statement comments

MySQL supports three types of comments:

1. From the '#' character from the end of the line.

2. From the '--' sequence to the end of the line. Please note that the '-- ' (double dash) comment style requires that the second dash be followed by at least one whitespace character (eg space, tab, newline, etc.).

3. From the /* sequence to the following */ sequence. The closing sequence does not have to be on the same line, so this syntax allows comments to span multiple lines.

The following example shows 3 styles of comments:

//How to write comment statements in mysqlmysql> SELECT 1+1; # This comment continues until the end of the linemysql> SELECT 1+1; -- This comment continues until the end of the linemysql> SELECT 1 /* This is a comment in the middle of a line*/ + 1;
mysql> SELECT 1+
/*
This is a multi-line comment form */
1;

The above comment syntax applies to how the mysqld server parses SQL statements. The MySQL client also performs some statement parsing before sending it to the server. (For example, it parses to determine statement boundaries in multi-statement lines).

Summarize

The above is all about the introduction of MySQL statement comment method in this article. Interested friends can refer to: MySQL optimization using connection (join) instead of subquery, MYSQL subquery and nested query optimization example analysis, MySQL in statement subquery efficiency optimization skills example, etc. If there are any deficiencies, please leave a message to point them out. The editor will reply to you in time and make corrections. I hope it will be helpful to you.

You may also be interested in:
  • Mysql Sql statement comments
  • MySql creates a table with explanation and annotates the table and fields
  • MariaDB (MySQL branch) my.cnf configuration file Chinese annotated version

<<:  React Diff Principle In-depth Analysis

>>:  Explanation of Dockerfile instructions and basic structure

Recommend

Detailed explanation of the difference between in and exists in MySQL

1. Prepare in Advance For your convenience, I cre...

Where is mysql data stored?

MySQL database storage location: 1. If MySQL uses...

mysqldump parameters you may not know

In the previous article, it was mentioned that th...

CSS clear float clear:both example code

Today I will talk to you about clearing floats. B...

How to delete garbled or special character files in Linux

Due to encoding reasons, garbled characters will ...

Detailed analysis of matching rules when Nginx processes requests

When nginx receives a request, it will first matc...

Mysql keeps the existing content and adds content later

This command modifies the data table ff_vod and a...

DOM operation implementation in react

Table of contents Previous words Usage scenarios ...

How to successfully retrieve VMware Esxi root password after forgetting it

Prepare a CentOS6 installation disk (any version)...

How to modify the contents of an existing Docker container

1. Docker ps lists containers 2. Docker cp copies...

What you need to know about msyql transaction isolation

What is a transaction? A transaction is a logical...

How to build a React project with Vite

Table of contents Preface Create a Vite project R...

Docker meets Intellij IDEA, Java development improves productivity tenfold

Table of contents 1. Preparation before developme...

Bootstrap 3.0 study notes grid system case

Preface In the previous article, we mainly learne...