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

Content-type description, that is, the type of HTTP request header

To learn content-type, you must first know what i...

How to install setup.py program in linux

First execute the command: [root@mini61 setuptool...

JavaScript canvas to achieve meteor effects

This article shares the specific code for JavaScr...

Summary of commonly used SQL statements for creating MySQL tables

Recently, I have been working on a project and ne...

CSS3 implements the sample code of NES game console

Achieve resultsImplementation Code html <input...

Introduction to new features of ECMAscript

Table of contents 1. Default values ​​for functio...

React Routing Link Configuration Details

1. Link's to attribute (1) Place the routing ...

Index Skip Scan in MySQL 8.0

Preface MySQL 8.0.13 began to support index skip ...

The actual process of implementing the guessing number game in WeChat applet

Table of contents Function Introduction Rendering...

Example of converting timestamp to Date in MySQL

Preface I encountered a situation at work: In the...

Pure CSS header fixed implementation code

There are two main reasons why it is difficult to...

Ten important questions for learning the basics of Javascript

Table of contents 1. What is Javascript? 2. What ...