【发布时间】:2017-07-03 11:42:42
【问题描述】:
我有以下 sql 查询:
SELECT `main_table`.* FROM `prd_brand` AS `main_table`
INNER JOIN
(SELECT DISTINCT value from catalog_product_entity_int where row_id in
(select row_id from catalog_product_entity_int where attribute_id = 97 and value = 1) ,
(select row_id from catalog_product_entity_int where attribute_id = 99 and value = 4)) t
ON main_table.brand_id = t.value
是否可以在WHERE IN 语句中添加多个select 查询。
顺便说一句,执行查询时我有#1248 - Every derived table must have its own alias。
【问题讨论】: