Optimization

This commit is contained in:
mba1398 2024-05-26 14:25:11 +08:00 committed by GitHub
parent 832489b2fe
commit 7ccc9b8272
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 0 deletions

View File

@ -218,6 +218,21 @@ DROP VIEW productsum;
```
如果我们继续操作这个视图的话就会提示当前操作的内容不存在。
### 3.1.8 查看视图
可以通过如下命令查看 `shop` 数据库下所有视图
```sql
USE shop;
SHOW TABLE STATUS WHERE COMMENT = 'view'
```
或者
```sql
SELECT * FROM
information_schema.views
WHERE TABLE_SCHEMA = 'shop'
```
## 3.2 子查询
我们先来看一个语句