Statement: The material used in this column is written by the VIP students of the Kay Academy, who has the right to be anonymous and has the final right to interpret the article; The Edith Academy is designed to promote students to learn from each other on the basis of public notes.
MySQL Advanced query 2
The Select Advanced query also has the following syntax, fuzzy query like, subquery, recordset merge union.
Fuzzy query like has the following three symbols%,_,[]. The syntax is as follows:
% represents any number, any character. For example:
SELECT * from Shaicheng WHERE username like '% ';
SELECT * from Shaicheng where username like '% ';
_ represents any single character. The syntax is as follows:
SELECT * from Shaicheng WHERE GROUPNAME like ' _ Shi ';
SELECT * from Shaicheng WHERE changci like ' __ field ';
[AB] can choose one character.
The subquery syntax is as follows:
If there are two combined tables,
If you are a relational operator, the result of a subquery can be only one (single-row). If you want to judge a long line of values, there is in. The in syntax is as follows:
The recordset Merge union syntax is as follows:
The queried column names are displayed according to the column names of the first table. The null query syntax is as follows:
The sort and condition can be written on the last query statement:
Sql--mysql Advanced Query 2