私は2つのテーブルを持っています。 1つはps_product_lang
とps_category_product
です。 ps_category_product
内のデータは次のようである。このMySQLテーブルジョインでデータを取得
id_category id_product
2 1
2 2
2 3
2 4
2 5
2 6
2 7
3 1
3 2
3 3
3 4
3 5
3 6
3 7
4 1
4 2
5 1
7 2
8 3
8 4
8 5
8 6
8 7
9 3
10 4
ps_product_lang
のためのテーブルには、だからここに私はid_categoryは5,7と 'のような名前ですps_product_langからid_product、名前を取得したいこの
id_product id_lang name
1 1 Faded Short Sleeves T-shirt
1 2 Faded Short Sleeves T-shirt
2 1 Blouse
2 2 Blouse
3 1 Printed Dress
3 2 Printed Dress
4 1 Printed Dress
4 2 Printed Dress
5 1 Printed Summer Dress
5 2 Printed Summer Dress
6 1 Printed Summer Dress
6 2 Printed Summer Dress
7 1 Printed Chiffon Dress
7 2 Printed Chiffon Dress
のようなものですp% 'である。だから誰かが私の質問になると私に教えてくれる。どんな助けや提案も本当に魅力的でしょう。
ヒント: 'JOIN'、' LIKE'。 –
@GordonLinoffはヒントのために感謝します。ここにコードを表示できますか? – NewUser