Help with QUERY I don't know where to start[TrinityCore Database Structure] menu

User Tag List

Results 1 to 7 of 7
  1. #1
    slater2k's Avatar Member
    Reputation
    1
    Join Date
    Jul 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with QUERY I don't know where to start[TrinityCore Database Structure]

    Hello I am in need of a MySQL [SQL] specialist's help

    I need to set the buyprice of all items with a certain vendor id

    To do this I need to select all item ids from the npc_vendor table where entry='vendorid'

    than with these items that are selected I would need to select all those item entry ids from item_template than set where item entry id buyprice='wtv' since there are a lot of vendors I want to adjust prices on with just a click but if I were to do it manually there would be thousands of items I would have to go through I think this query would be possible but I am not good enough in SQL to write this query

    Thanks for reading and future help

    thanks for future help

    Help with QUERY I don't know where to start[TrinityCore Database Structure]
  2. #2
    Rock Lee's Avatar Banned
    Reputation
    41
    Join Date
    Jul 2010
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    SELECT *
    FROM npc_vendor
    WHERE entry = "vendorid" OR entry = "vendorid2"

  3. #3
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    UPDATE item_template SET buyprice = 'price' WHERE entry IN (SELECT item FROM npc_vendor WHERE entry = 'vendorid')
    If you want to run it on multiple vendors at once use this query instead:

    Code:
    UPDATE item_template SET buyprice = 'price' WHERE entry IN (SELECT item FROM npc_vendor WHERE entry in (vendorid1, vendorid2, vendorid3 and so on))
    Ignorance is bliss.

  4. #4
    slater2k's Avatar Member
    Reputation
    1
    Join Date
    Jul 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Dynashock View Post
    Code:
    UPDATE item_template SET buyprice = 'price' WHERE entry IN (SELECT item FROM npc_vendor WHERE entry = 'vendorid')
    If you want to run it on multiple vendors at once use this query instead:

    Code:
    UPDATE item_template SET buyprice = 'price' WHERE entry IN (SELECT item FROM npc_vendor WHERE entry in (vendorid1, vendorid2, vendorid3 and so on))
    Thank you greatly appreciated

  5. #5
    slater2k's Avatar Member
    Reputation
    1
    Join Date
    Jul 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok now I have another question how would I use this query and only update the buyprice of the entry items if the itemlevel field is less than or equal to a certain number?

  6. #6
    marcelo_20xx's Avatar Active Member
    Reputation
    25
    Join Date
    Sep 2008
    Posts
    165
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    UPDATE item_template SET buyprice = 'price' WHERE entry IN (SELECT item FROM npc_vendor WHERE entry = 'vendorid' ) AND itemlevel <='number';
    Code:
    UPDATE item_template SET buyprice = 'price' WHERE entry IN (SELECT item FROM npc_vendor WHERE entry in (vendorid1, vendorid2, vendorid3 and so on)) AND itemlevel <='number';

  7. #7
    slater2k's Avatar Member
    Reputation
    1
    Join Date
    Jul 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aha thats how you do it with the AND syntax thank you

Similar Threads

  1. Pls help me , got robbed and now i don't know where i'm at
    By nevestop82 in forum League of Legends Buy Sell Trade
    Replies: 0
    Last Post: 09-02-2016, 01:14 PM
  2. [Lazy Bot] Issues with.. Well, I don't know.
    By xrandomz in forum WoW Bot Maps And Profiles
    Replies: 4
    Last Post: 08-05-2012, 08:52 PM
  3. [Lazy Bot] Issues with.. Well, I don't know.
    By xrandomz in forum WoW Bots Questions & Requests
    Replies: 3
    Last Post: 08-05-2012, 02:57 AM
  4. I don't know where to post this but
    By AutomaticCoding in forum World of Warcraft General
    Replies: 5
    Last Post: 11-14-2010, 07:13 PM
  5. Want to make millions by playing the AH? But don't know where to start?
    By Unholyshaman in forum World of Warcraft Guides
    Replies: 16
    Last Post: 01-16-2010, 05:11 PM
All times are GMT -5. The time now is 08:24 AM. 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