这是一篇SQL基础语法的查询手册。
- SELECT语言
SELECT column_name,column_name FROM table_name;
- SELECT DISTINCT 语法
SELECT DISTINCT column_name,column_name FROM table_name;
- WHERE 语句
SELECT column_name,column_name FROM table_name WHERE column_name operator value;
- AND & OR 运算符
SELECT * FROM table_name WHERE column_name=.. AND column_name=.. ;
SELECT * FROM table_name WHERE column_name=.. OR column_name=.. ;
- ORDER BY 关键字
SELECT column_name,column_name FROM table_name ORDER BY column_name,column_name ASC|DESC;
- INSERT INTO 语法
- 形式一:
INSERT INTO table_name VALUES (value1,value2,value3,...);
- 形式二:
INSERT INTO table_name (column1,column2,column3,...) VALUES (value1,value2,value3,...);
- UPDATA语法
UPDATE table_na