テーブルオファー
id_offer offer state
600 A 0
629 B 0
タグ
id_tags tags
561 PHP
562 JAVA
589 MySQL
917 python
offer_has_tags
offer_id_offer tags_id_tags
600 561
600 562
600 917
629 562
629 589
629 917
私が必要とする出力:
600 PHP
600 JAVA
600 python
629 JAVA
629 MySQL
629 python
私がしようとしていること(成功せずに):
SELECT A.id_offer, A.tags
FROM
( SELECT *
FROM offer
WHERE id_offer IN (600, 629)
AND state = 0
ORDER BY date_post DESC
LIMIT ?, ?
) A, tags A
INNER JOIN offer_has_tags B
ON A.id_tags = B.tags_id_tags
INNER JOIN offer C
ON C.id_offer = B.offer_id_offer
GROUP BY id_tags
何か案が?ありがとう