SQL 实例
创建于 2024-12-02 /
56
字体:
[默认]
[大]
[更大]
SQL 语法
Select all the records from a specific table ("Customers")SQL SELECT
SELECT Column SELECT *SQL SELECT DISTINCT
SELECT DISTINCT SELECT COUNT(DISTINCT column_name) SELECT COUNT(DISTINCT column_name) workaround for MS AccessSQL WHERE
WHERE Clause Text Fields vs. Numeric FieldsSQL AND, OR and NOT Operators
AND OR NOT Combining AND, OR and NOTSQL ORDER BY
ORDER BY ORDER BY DESC ORDER BY Several ColumnsSQL INSERT INTO
INSERT INTO Insert data in specific columnsSQL NULL Values
IS NULL Operator IS NOT NULL OperatorSQL Update
UPDATE Table UPDATE Multiple Records UPDATE Warning (if you omit the WHERE clause, all records will be updated)SQL DELETE
DELETE DELETE All RecordsSQL SELECT TOP
SELECT TOP LIMIT SELECT TOP PERCENT SELECT TOP and add a WHERE ClauseSQL MIN() and MAX()
MIN() MAX()SQL COUNT, AVG() and SUM()
COUNT() AVG() SUM()SQL LIKE
LIKE - select all table rows starting with "a" LIKE - select all table rows ending with "a" LIKE - select all table rows that have "or" in any position LIKE - select all table rows that have "r" in the second position LIKE - select all table rows that starts with "a" and ends with "o" LIKE - select all table rows that does NOT start with "a"SQL Wildcards
Using the % Wildcard Using the _ Wildcard Using the [charlist] Wildcard Using the [!charlist] WildcardSQL IN
IN NOT INSQL BETWEEN
BETWEEN NOT BETWEEN BETWEEN with IN BETWEEN Text Values NOT BETWEEN Text ValuesSQL Aliases
Alias for Columns Two Aliases Alias for TablesSQL Joins
INNER JOIN LEFT JOIN RIGHT JOIN Self JOINSQL UNION
UNION UNION ALL UNION With WHERE UNION ALL With WHERESQL GROUP BY
GROUP BY GROUP BY and ORDER BY GROUP BY With JOINSQL HAVING
HAVING and GROUP BY HAVING and ORDER BYSQL EXISTS
EXISTSSQL ANY and ALL
ANY ALLSQL INSERT INTO SELECT
INSERT INTO SELECT INSERT INTO SELECT with WHERESQL CASE
CASE 1 CASE 2SQL Comments
Single Line Comments Single Line Comments At The End Of a Line Multi-line CommentsSQL Database
SQL Database tutorials can be found here:
SQL Create DB SQL Drop DB SQL Backup DB SQL Create Table SQL Drop Table SQL Alter Table SQL Constraints SQL Not Null SQL Unique SQL Primary Key SQL Foreign Key SQL Check SQL Default SQL Index SQL Auto Increment SQL Dates SQL Views SQL Injection SQL Hosting
0 人点赞过