This works:
update my_table set credits_total = credits_total + 1 where id = 4;
But this doesn't:
SET @add_credits = 1;
update my_table set credits_total = credits_total + @add_credits where id = 4;
It's giving me a 'column credits_total cannot be null' error.
What am I doing wrong? Thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…