开发者

How can I insert a value to the value that i just selected?

sb.Append("SELECT u.Reputation");
sb.Append(" FROM Use开发者_运维百科rs AS u");
sb.Append(" INNER JOIN Comments AS c ON c.UsersID=u.UsersID");
sb.Append(" WHERE c.CommentsID=@CommentsID");

I want to select that value ..Reputation from the users table and then insert the number 5 to it.. how do I do that..? I want the users reputation go by value of 5 in the database.


UPDATE Users u 
SET u.Reputation = (u.Reputation + 5) 
INNER JOIN Comments AS c ON c.UsersID=u.UsersID 
WHERE c.CommentsID=@CommentsID
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜