Products と ProductImages の 2 つのテーブルがあり、Products と ProductImages の間に 1 対多の関係があります。ProductImages テーブルのレコードが一致する行のみが結果に含まれるという条件で、Products テーブルに対してクエリを実行しようとしています。
Products
----------
id (PK)
ProductImages
---------------
id (PK)
product_id (FK to Products)
私ができる唯一の方法はサブクエリを使用することですが、より良い/より効率的な方法があるはずです。