示例表A:
author_id | author_name |
1 | Kimmy |
2 | Abel |
3 | Bill |
4 | Berton |
示例表B:
book_id | author_id | start_date | end_date |
9 | 1 | 2017-09-25 21:16:04 | 2017-09-25 21:16:06 |
10 | 3 | ||
11 | 2 | 2017-09-25 21:21:46 | 2017-09-25 21:21:47 |
12 | 1 | ||
13 | 8 |
示例表C:
order_id | book_id | price | order_date |
1 | 9 | 0.2 | 2017-09-24 21:21:46 |
2 | 9 | 0.6 | 2017-09-25 21:16:04 |
3 | 11 | 0.1 | 2017-09-25 21:21:46 |
在以上表中执行AB表关联
1 2 |
|
结果
author_id | author_name | book_id |
1 | Kimmy | 9 |
3 | Bill | 10 |
2 | Abel | 11 |
1 | Kimmy | 12 |
4 | Berton |
结果出现了2条author_id为1的记录,因为右表中存在了两条关联author_id=1的行
右边出现N条关联左边的记录,结果就会相应出现N条关联了右表出现的记录
在以上表中执行ABC表关联
1 2 3 |
|