day04
## 联表查询
```sql
select xx from xx left join xx on xx --左连接
select xx from xx right join xx on xx --右连接
select xx from xx inner join xx on xx --右连接
--可以加where加条件
--on后面加两张表都有的列属性
```
## 自连接
```sql
--查询父子信息:把一张表看为两张一模一样的表
select a.`categoryName` as `父栏目`,b.`categoryName` as `子栏目`
from `category` as a ,`category` as b
where a.`categoryid`=b.`pid`
--drder by asc升序 /dec 降序
--limit 起始页,pagesize
order by StudentResult Asc/dsc
limit 5,5
```

浙公网安备 33010602011771号