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
精彩评论