Welcome to AC Web.
Results 1 to 3 of 3
  1. #1

    SQL Query Build Help


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hello, hope everyone is safe in these hard times.

    Well i need some help to create 2 SQL queries that i couldn't figure out how to build.

    I am running trinity core server.


    1st query : Is to update 'Item_template items where bonding=0 required level to quest_template MinLevel'
    So the idea is to to get the min level from quest_template and replace the required level of the items where
    bonding=0

    2nd query : Is to Delete creature_queststarter and creature_questender where allowable class > 0 in quest_template_addon
    and MinLevel <50 in quest_template.


    would appreciate if there was a select query before implementing those queries to chck before editing.

    Thanks

  2. #2
    Web Developer

    Join Date
    Oct 2010
    Location
    somewhere between <?php and ?>
    Posts
    3,067
    I dont really understand your first query. Each quest have different minlevel you know, which item will get which minlevel from which quest? It's kinda confusing...

    Anyway, 2nd query should be something similar to
    Code:
    DELETE FROM creature_queststarter WHERE quest IN (SELECT qta.id FROM quest_template_addon qta INNER JOIN quest_template qt ON qt.id = qta.ID WHERE qta.allowableclasses > 0 AND qt.MinLevel < 5)
    You may try that and see if it works. Make a backup first tho

    - - - Updated - - -

    The query above will delete from quest starter, Just change name of table to delete from questender

    - - - Updated - - -

    To be more safe you can always try run query as a select query at first so you can see which quests will be deleted.
    Code:
    SELECT * FROM creature_queststarter WHERE quest IN (SELECT qta.id FROM quest_template_addon qta INNER JOIN quest_template qt ON qt.id = qta.ID WHERE qta.allowableclasses > 0 AND qt.MinLevel < 5)

  3. #3

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Thanks @Tok124 much love

    Yeah 1st query is confusing alot. Well the idea i am removing bonding from items. The result will be having quest reward items "GEAR" with no required lvl. The query is to search for the minlevel required for the quest of those particular items and use that for their required level.
    Its a good idea to search in item_template for inventory type > 0 so its gear also.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •