sql 常见增删改查
操作数据(DML)
2.1 插入数据(添加)
插入语句:一次插入操作只插入一行.
INSERT INTO table_name (column1,column2,column3...)
VALUES(value1,value2,value3...);
2.2 修改数据
UPDATE table_name
SET columnName = value [, columnName = value] …
[WHERE condition];
2.3 删除数据
DELETE FROM tablename
[WHERE condition];
2.4 查询数据
select * from table_name
[WHERE condition];
升序:
sql默认是按照ID的升序来展示。
select * from work_detail
降序:
select * from work_detail ORDER BY id DESC