私はPHPとMySqlを使っています。私はmysqlテーブルからいくつかのムービーを選択する方法を見つけようとしていますが、ムービーテーブルとは別に、ウォッチリストテーブルにuserIDとムービーIDを格納しています。 :2つのmysqlテーブルに参加してtrue/falseカラムを取得する
movieID title duration added
=======================================
1 tit1 34:43 false
2 tit2 35:43 false
3 tit3 24:43 true
4 tit4 34:13 false
5 tit5 11:43 true
6 tit6 22:43 false
7 tit7 33:43 true
あります:
id userID movieID
=====================================
1 1 3
2 1 5
3 1 7
4 2 3
5 2 2
6 3 2
映画の表は、この
movieID title duration
=============================
1 tit1 34:43
2 tit2 35:43
3 tit3 24:43
4 tit4 34:13
5 tit5 11:43
6 tit6 22:43
7 tit7 33:43
私は(ID 1を持つユーザーのために、たとえば)された後だ結果のようなものが見えますジョイへの道∎映画とウォッチリストテーブルの両方で、希望の結果を生成できますか?
ありがとうございました。
可能な重複https://stackoverflow.com/questions/4796872/how-to-do-a-full-outer-join-in-mysql。 –