閱讀大約Triggers
,Equi-Joins
和cross-joins
我的頭部旋轉,無法弄清楚我需要什麼。基於另一個表格自動插入數據
基本上,我有3個表:
Table 1: Users
id
username
score
Table 2: Acts
act_id
act
user_id
act_score
Table 3: Votes
vote_id
act_id
user_voter
score_given
當投票演員,我希望MySQL的score_given
自動添加到用戶score' and to the
act_score`。
這是可能的,我需要什麼類型的JOIN
和/或TRIGGER
。如果有人感到非常慷慨,他們能否提供給我sql代碼?我真的努力讓我解決這個頭......
你需要更新後觸發投票表。 – Melon