Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-18-2014, 02:52 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 255
Default Mysql Query Help, Spell Merging.

Hello all,

I dont know if you guys offer any help on sql queries but If so, I could use some! I have tried and tried but cannot figure it out.

What I am trying to accomplish is copying info from my old spell_new to the new spell_new from the latest peqbeta.sql

I have renamed my spell table to spell_old and the new is obviously spell_new.
I am doing this because I have changed values like spell levels and am wanting to start with a new table with fresh changed. So the query I am looking for is match this column of tableA with tableB and if match, merge info, If it doesnt match then do nothing. I got it to sorda work once and anything that matched merged fine but anything that didnt match got turned to 0 value.

This is the one that worked but changed unmatching to 0, which i need to fix.
Code:
UPDATE spells_new 
SET spells_new.classes14 = (
    SELECT spells_old.classes14
    FROM spells_old
    WHERE spells_old.name = spells_new.name LIMIT 1
);

This is 1 i am playing around, dont know exactly if INNER JOIN is what i need but still trying.
Code:
SELECT name
FROM spells_old
INNER JOIN spells_old.classes1 ON spells_new.name = spells_old.name;
Thanks guys!

Fig
__________________
Reply With Quote
  #2  
Old 10-18-2014, 03:06 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

You don't have to do this. Just have an exported spell file from the old database, make a folder in your server folder called 'import' and run your import_client_files.exe. The change in column names is only for helping with understanding, the number of columns in the spells_us.txt is constant, meaning it can be imported or exported from any database and contain the same number of columns in the .txt file.
Reply With Quote
  #3  
Old 10-18-2014, 03:25 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 255
Default

Hmm I am only tryen to update only certain columns though, not everything. I dont want my particles to change bc I had changed them b4.... Does that merge everything? From what you typed i think sounds like something different than I am neededing.
__________________
Reply With Quote
  #4  
Old 10-18-2014, 03:28 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

It puts in the entire spell file. So just export your old spell file from your old database, if you have one already you can just import the old spell file as is.
Reply With Quote
  #5  
Old 10-18-2014, 03:34 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 255
Default

ya, thats not what i need. I know how to i/o spell files and such. I am tryen to take matching names(spellname) from table2 to table1 if they match then copy info over.
__________________
Reply With Quote
  #6  
Old 10-18-2014, 08:03 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 255
Default

i got it figured out. Thanks tho
__________________
Reply With Quote
  #7  
Old 10-24-2014, 10:31 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 255
Default

The fix. Forgot to post for people to use.


Code:
UPDATE spells_new
JOIN   spells_old ON spells_new.name = spells_old.name
SET    spells_new.mana = spells_old.mana
__________________
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:14 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3