I want to use sql to save the process of moving goods between 2 shops. I have two tables: A:
| id | shop | good_sn |
|---|---|---|
| 1 | 1 | aaa |
| 2 | 1 | bbb |
| 3 | 1 | ccc |
| 4 | 2 | ddd |
B:
| id | shop_from | shop_to | good_sn |
|---|---|---|---|
| 1 | 1 | 2 | bbb |
and I want to select a table like this:
| shop | good_sn |
|---|---|
| 1 | aaa |
| 1 | ccc |
| 2 | ddd |
| 2 | bbb |
Does anyone have any query ideas for this case?