MySQL 实例

创建于 2024-12-02 / 29
字体: [默认] [大] [更大]

MySQL SELECT

SELECT Column SELECT * SELECT DISTINCT SELECT COUNT(DISTINCT olumn_name)

示例解析


MySQL WHERE

WHERE Clause Text Fields vs. Numeric Fields

示例解析


MySQL AND, OR and NOT

AND OR Another OR NOT Combining AND and OR Combining AND and NOT

示例解析


MySQL ORDER BY

ORDER BY ORDER BY DESC ORDER BY Several Columns ORDER BY Several Columns + ASC and DESC

示例解析


Advertisement

-->

MySQL NULL Values

IS NULL Operator IS NOT NULL Operator

示例解析


MySQL LIMIT

LIMIT LIMIT with WHERE

示例解析


MySQL MIN() and MAX()

MIN() MAX()

示例解析


MySQL COUNT(), AVG() and SUM()

COUNT() AVG() SUM()

示例解析


MySQL LIKE

Select all table rows starting with "a" Select all table rows ending with "a" Select all table rows that have "or" in any position Select all table rows that have "r" in the second position Select all table rows that starts with "a" and ends with "o" Select all table rows that starts with "a" and are at least 3 characters in length Select all table rows that does NOT start with "a"

示例解析


MySQL Wildcards

The % Wildcard The _ Wildcard

示例解析


MySQL IN

IN NOT IN IN with SELECT

示例解析


MySQL BETWEEN

BETWEEN NOT BETWEEN BETWEEN with IN BETWEEN Text Values NOT BETWEEN Text Values BETWEEN Date Values

示例解析


MySQL Aliases

Alias for Columns Two Aliases An Alias that contains multiple columns Alias for Tables

示例解析


MySQL Joins

INNER JOIN - Join two tables INNER JOIN - Join three tables LEFT JOIN RIGHT JOIN CROSS JOIN Self Join

示例解析


MySQL UNION

UNION UNION ALL UNION with WHERE UNION ALL with WHERE

示例解析


MySQL GROUP BY

GROUP BY GROUP BY and ORDER BY GROUP BY with JOIN

示例解析


MySQL HAVING

HAVING and GROUP BY HAVING and ORDER BY HAVING and WHERE

示例解析


MySQL EXISTS

EXISTS - Price less than 20 EXISTS - Price equals 20

Example Explained


MySQL ANY and ALL

ANY - Example 1 ANY - Example 2 ANY - Example 3 ALL - Example 1 ALL - Example 2

示例解析


MySQL CASE

CASE 1 CASE 2

示例解析


MySQL Comments

Single line Comment Single line comment at the end of a line Single line comments to ignore statement Multi line comment Multi line comment to ignore many statement

示例解析


MySQL 数据库

MySQL 数据库教程可以在这里找到:

MySQL Create DB MySQL Drop DB MySQL Create Table MySQL Drop Table MySQL Alter Table MySQL Constraints MySQL Not Null MySQL Unique MySQL Primary Key MySQL Foreign Key MySQL Check MySQL Default MySQL Create Index MySQL Auto Increment MySQL Dates MySQL Views


0 人点赞过