【发布时间】:2018-02-20 09:19:16
【问题描述】:
I have two tables as follow:
1. products :
columns:
id integer,
Sku string,
....
2. cars :
columns:
id integer,
brand integer,
type_of_car enum,
...
我考虑过创建一个数据透视表 product_car,其中产品 ID 将映射到汽车 ID 或 type_of_car。
现在我面临的问题是,我不知道如何将连接表的两列(即 Car 表的 id 或 type_of_car)映射到单个表(即产品的 ID)关系数据库。
Some On 也可以建议我替代方法吗?
【问题讨论】: