SQL 命令彙集
命 令 | 格 式 | |
Select | Select "欄位" From "表格名"; | |
Where | Select "欄位" From "表格名" Where "condition"; | |
In | SELECT "欄位" | |
Like | SELECT "欄位" | |
Count | SELECT COUNT("欄位") | |
Group by | SELECT "欄位1", SUM("欄位2") | |
Create | CREATE TABLE "表格名" | |
Drop | DROP TABLE "表格名"; | |
Truncate | TRUNCATE TABLE "表格名"; | |
Update | UPDATE "表格名" | |
比較 | =、 <> 、 < 、> 、 >=、between | |
聚合 | Count(欄位)、Ave、Sum、Max、Min | |
Distinct | Select Distinct "欄位" From "表格名"; | |
And/OR | Select "欄位" From "表格名" Where "簡單條件" {[And|Or] "簡單條件"}+ ; | |
Between | SELECT "欄位" | |
Order By | SELECT "欄位" | |
Having | SELECT "欄位1", SUM("欄位2") | |
Insert | INSERT INTO "表格名" ("欄位1", "欄位2", ...) | |
Delete | DELETE FROM "表格名" | |
(Not) Like | *、_(底線)、%、[ABC]、Pattern | |
運算 | +、-、*、/、% |
熱門評論