Auto commit
This commit is contained in:
parent
18e2b8d571
commit
7396f8a08a
@ -91,6 +91,27 @@ VALUES
|
||||
|
||||
由于业务变化,图书馆不再需要文学类的图书,现要求删除类型文学类产,并将对应的图书一并删除。
|
||||
|
||||
```sql
|
||||
/*
|
||||
DELETE FROM 表名
|
||||
WHERE 条件;
|
||||
*/
|
||||
#由于业务的需要,发布时间在2010年以前的不再出售,需要全部清理。
|
||||
DELETE FROM book
|
||||
WHERE YEAR(book_date) < 2010;
|
||||
#YEAR(日期) 获取日期的年份
|
||||
|
||||
#由于业务变化,图书馆不再需要文学类的图书,现要求删除类型文学类产,并将对应的图书一并删除。
|
||||
#1.先删除文学类的图书 2.还需要删除文学类这个图书类
|
||||
DELETE FROM book
|
||||
WHERE book_type = 1;
|
||||
|
||||
DELETE FROM booktype
|
||||
WHERE type_id = 1;
|
||||
```
|
||||
|
||||
|
||||
|
||||
## MySQL查询
|
||||
|
||||
### 使用内连接显示图书详细信息
|
||||
|
Loading…
x
Reference in New Issue
Block a user