我在我的mysql數據庫中有兩個表。 表1:在線留言板 表2:用戶SQL JOIN 2條件
我的表看起來像這樣
TABLE SHOUTBOX (id, name, title, user_id)
TABLE USERS (id, name, profile_image)
我想要做的是顯示了從表吼吼箱,但 條件必須是其中profile_image =「2」 USERS表所以我 試過這樣:
SELECT shoutbox.id, shoutbox.name, shoutbox.title, shoutbox.user_id, user.profile_image
FROM shoutbox, users
WHERE users.profile_image = '2'
我得到了很錯誤的結果。 所以我總是新手在這個所以請幫忙=)
謝謝你,工作就像一個魅力! =) – Mensur
你好,歡迎隊友! ':D' –