• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Need Sql Query

Status
Not open for further replies.

Come2WoW

Respected Member
Can u make a Item_templat Sort by for me ?(all Ataminas go stat_type10 and all Attackpowers , Apell powers go stat_type9 and all Agilitys ,Stranghs,Intelect Go stat_sype8

see this :
...
INSERT INTO `item_template` ( `StatsCount`,`stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`, `stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`, `stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`) VALUES ( 10,7, 350, 32, 150, 36, 70, 3, 250, 38, 350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
...
After the change with sql query:
...
INSERT INTO `item_template` ( `StatsCount`,`stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`, `stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`, `stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`) VALUES ( 10,0, 0 ,32, 150, 36, 70, 0, 0, 0, 0, 0, 0, 0, 0, 3, 250, 38, 320, 7, 350);
...
 

Hamar

BETA Tester
I think he wants to swap the column data to stat_value10 & stat_type10 if other stat_type column has stat type set as 7
Never done this on SQL but in c# application where i have entered the item entry.
 

Jiinx

BETA Tester
The bigger question is why? The stats will be present on the item regardless of the the position of the stat filed (stat_type(1-10).

Are you planning on every items having all 10 stat fields filled with something. normalization rules applied, you should only, be using as many type fields as needed and setting the count accordingly.

Maybe if we understood the why behind this request we could help with a solution.

~jiinx
 

Come2WoW

Respected Member
ty all i can update all staminas in item_template whit this query :(Give versatile :D)
UPDATE `item_template` SET `stat_value1` = `stat_value1` * 30 WHERE `stat_type1` = 7;
UPDATE `item_template` SET `stat_value2` = `stat_value2` * 30 WHERE `stat_type2` = 7;
UPDATE `item_template` SET `stat_value3` = `stat_value3` * 30 WHERE `stat_type3` = 7;
UPDATE `item_template` SET `stat_value4` = `stat_value4` * 30 WHERE `stat_type4` = 7;
UPDATE `item_template` SET `stat_value5` = `stat_value5` * 30 WHERE `stat_type5` = 7;
UPDATE `item_template` SET `stat_value6` = `stat_value6` * 30 WHERE `stat_type6` = 7;
 
Status
Not open for further replies.
Top