Figback65
10-18-2014, 02:52 PM
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.
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.
SELECT name
FROM spells_old
INNER JOIN spells_old.classes1 ON spells_new.name = spells_old.name;
Thanks guys!
Fig
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.
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.
SELECT name
FROM spells_old
INNER JOIN spells_old.classes1 ON spells_new.name = spells_old.name;
Thanks guys!
Fig