阅读大约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