: - 日 -PHP MySQL:複数のテーブルを選択し、パフォーマンスサマリーを返す方法PHPで結果を取得する方法
- NU61 2011
- KE2I - ボール - 2000
- B8WO - ポイント - 2008
table_firstSELECT id, order, date FROM table_first ORDER BY orders DESC
返信id
、date
id | orders | date
------+---------+------
KE2I | 2 | 2000
B8WO | 5 | 2008
NU61 | 1 | 2011
table_secondSELECT key FROM table_second WHERE id=(id from table_first)
がtable_third
id | key
------+-----------------
KE2I | .b
B8WO | .p
NU61 | .s
table_thirdSELECT content FROM table_third WHERE id=(key from table_second)
リターンcontent
id | content
------+-----------------
.b | ball
.p | point
.s | sun
3つのテーブルからデータを選択する上で、より良いパフォーマンスを得るための任意のより良い解決策? – Binyamin
@ビニャミンあなたの元の質問ではないですか?これは私の答えです=) – Shad
ありがとう!あなたが 'DESC'とPHPを注文したことを忘れたのを除いて、うまくいっているようですが、気にしません。 – Binyamin