Need a SQL Query PRO! menu

User Tag List

Results 1 to 5 of 5
  1. #1
    Wolverine77's Avatar Member
    Reputation
    9
    Join Date
    Dec 2007
    Posts
    213
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need a SQL Query PRO!

    I want to add lets say 40 to an existing number in a colum.

    Like i want to add 40 vote points to every player.

    Need a SQL Query PRO!
  2. #2
    latruwski's Avatar Banned
    Reputation
    647
    Join Date
    Dec 2006
    Posts
    2,456
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this:
    Code:
    Update player set votepoints=((select votepoints from player;)+40);
    where player = tablename and votepoints = votepoints column
    This should do it for all players if you want to do it for 1 player add a 'where' statement

    grtz

  3. #3
    Dythzer's Avatar Contributor
    Reputation
    271
    Join Date
    May 2008
    Posts
    461
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That wont work, but you can simply do this:
    Code:
    UPDATE table SET column = column + 40 WHERE column = id;
    Replace id with the player id

  4. #4
    Kalash47's Avatar Member
    Reputation
    12
    Join Date
    Oct 2008
    Posts
    61
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Dythzer View Post
    That wont work, but you can simply do this:
    Code:
    UPDATE table SET column = column + 40 WHERE column = id;
    Replace id with the player id
    Can be even simpler than that

    Code:
    UPDATE `table` SET `column`+='40' WHERE `column`='id';

  5. #5
    latruwski's Avatar Banned
    Reputation
    647
    Join Date
    Dec 2006
    Posts
    2,456
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it should work the thing i said... maybe not perfectly right syntax but it should as it is exacly the same as what you do only you guys do it shorter
    UPDATE `table` SET `column`+='40' WHERE `column`='id';

    there is something cool I don't know how i didn't post that >< I learn java at school, we use that all the time xD

Similar Threads

  1. [SQL] Need help with npc_trainer sql query
    By bergis1337 in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 03-08-2011, 05:33 PM
  2. Need Help With two SQL Queries
    By BoP in forum Programming
    Replies: 3
    Last Post: 06-12-2008, 09:15 PM
  3. [help] I Need A Sql
    By Dragonscale in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 12-27-2007, 06:18 AM
  4. Warrior Stances SQL Query
    By toxic11b in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 12-18-2007, 07:35 PM
  5. i need help from a pro!!!
    By orangegold in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 04-17-2007, 06:46 PM
All times are GMT -5. The time now is 06:19 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search