0
我有两种类型的产品。我为这些(t1,t2)创建了两个表。我也有一个事务表(T3),我想加入T3与T1,但如果没有匹配,则加入T2有条件加入mysql
T1
|p_id|p_description|color|
|0001| xyz |blue |
|0002| bcd |red |
T2
|p_id|p_description|weight||size|type|
|e-01| xmay |3.25| | 50| s |
|s-02| cmay |2.32| | 25| x |
T3
|trn_id| p_id |cost|
| 1 | 0001 | 150|
| 2 | s-02 | 225|
的if else或case语句 – Haris
这不应该是两个具有不同列数的产品表格摆在首位。一个产品表,其中包含所有产品都具有的基本字段 - 其余的则放入产品属性表中,形式为“product id |属性id |属性值“ – CBroe