
碰到有过山炮电话里直接问啥啥操作SQL怎么写的,这几年没写过,连syntax都忘记了。记下来备用。
insert 的两种形式
1 |
INSERT INTO table_name |
1 |
INSERT INTO table_name (column1,column2,column3,...) |
SQL UPDATE Syntax
1 |
UPDATE table_name |
SQL IN Syntax
1 |
SELECT column_name(s) |
Different SQL JOINs
1 |
INNER JOIN: Returns all rows when there is at least one match in BOTH tables |
The UNION operator is used to combine the result-set of two or more SELECT statements.
Notice that each SELECT statement within the UNION must have the same number of columns. The columns must also have similar data types. Also, the columns in each SELECT statement must be in the same order.
SQL UNION Syntax
1 |
SELECT column_name(s) FROM table1 |




近期评论