Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.33 KB | None | 0 0
  1. SET NOCOUNT ON
  2.  
  3. DECLARE @nAmount INT
  4. DECLARE @nCharId INT
  5. DECLARE @nItemType INT
  6.  
  7. SET @nItemType = 14543
  8. SET @nAmount = NULL
  9. SET @nAmount = NULL
  10.  
  11.  
  12. SELECT @nAmount = SUM(amount), @nCharId = char_id FROM user_item WHERE item_type = @nItemType GROUP BY char_id
  13.  
  14. UPDATE user_item SET amount = @nAmount WHERE char_id = @nCharId
  15.  
  16. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement