0
我有兩個表在mysql數據庫中,「點」和「用戶點」。 e.g如何查找使用另一個表作爲參考信息
點:
id | pointvalue | message
----------------------------
1 | 5 | comment
Userpoints:
id | uid |pid | timestamp
-------------------------
89 | 5 | 1 | timestamp
我將如何獲得在userpoints表點的總和時,它正受到userpoints的PID聯繫?
使用mysql查詢?
我將如何選擇點,其中uid =變量?那麼,對於有5個或10個人的人來說,積分是多少? – Aaron
@Matthew:編輯了添加WHERE條款的答案。如果你打算使用'WHERE'子句,那麼你不需要'GROUP BY'子句。 – Shef