我有两个表,每个表有3列,我需要在product_type上加入这些表。我怎么能这样做?
table1 has columns
category(varchar), subcategory(varchar), product_type(json)
table2 has columns
product_type(varchar), brand(varchar), attribute(json)
product_type(json) has list of product_type.
我怎么能这样做? 我这样想:
select subcategory, a.product_type, brand, attribute
from table1 as a, table2 as b
where a.product_type::text = b.product_type and category = "bike";