What is the MySQL syntax?
This article is to share with you what MySQL grammar has. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1.Where conditional qualification
Limit the search for people whose name is yu1.
Use or to limit the search condition to both. Then and must satisfy two items at the same time.
2. > =
< 使用也是为了限定条件。 3.模糊查询like %代表y前后的东西 也可使用断横杠模式like查询 每个断横杠代表一个字母或者数字 4.order by排序 默认情况下,只使用order by但不加参数的情况下是自动升序排序。 降序加上desc 升序的话是加上asc或者什么都不加 使用两种条件排序,age desc name ase,处理可能有相同条件的数据 5.聚合函数和聚合语法 聚合函数:sum() count() 聚合语法:group by xxx(以XXX分组) having xxx(过滤结果) 6.子查询和使用别名 把select name,age,count(name) as a from ruozedata group by name,age的结果作为a,把括号里的结果做成t表并且当a>1. Query the t table to get the result.
7. Limit
And finally, limit!
8. Combinatorial compilation
Order: select name,age,count (name) as a from ruozedata
Where age > 22
Group by name,age
Having count (name) > = 1
Order by name desc
Limit 3
9.join
Left join: take the table to the left of the command as the main table, and the other tables match.
Right join:
Jion=inner join: both match the same data of the two tables
Thank you for reading! This is the end of this article on "what is MySQL Grammar?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!