0

グループID = 1(結果1)のテーブル1からアイテムを見つける必要があり、次にグループID = 1のアイテムを検索し、テーブル2に移動して結果1をフィルタリングし、それらの価格ID = 200のみを選択しますテーブル1、アイテムID、グループIDテーブル2、商品ID、価格ID

内部結合を選択しようとしましたが、フィルタリングできません。列データが同じではないため、ユニオンはすべてエラーを返します。

select item id, group id 
from table 1 
where groupid = '1'
inner join 
   select item id, price id 
   from table 2 
   where price id = '200'
4

2 に答える 2

0

試す

select * from table2 as t2 inner join (select * from table1 where groupid=1) as t1
on t1.itm_id =t2.itm_id where t2.price_id=200
于 2013-09-20T02:32:23.293 に答える