Percentage SQL Command?

Sorry if this has been posted before, I just fail at search bars.

I’m trying to nerf a specific set of gear. (Deadly, Relentless, and Wrathful, actually.) By roughly 85%. Is there any SQL command that can do this? I remember I did it one time, a WHILE back, but I forget what I wrote in the query.

Would probably be three, like, — UPDATE item_template WHERE name = ‘Deadly Gladiator’ —, and so on.

Any help?

Bump…

Don’t bump your threads! Read the rules!

Sorry, lol. Just waiting for an answer.

UPDATE SET table = table * coeff?

Edit: And obviously if you want a constant coef you should make it a variable

SET @blabla := coeff;

Update SET table = table * @blabla

Wouldn’t this change the entire table? I just want a few item sets, so maybe a WHERE function that would sort through the names?

So maybe add the WHERE clause and run the query to see the outcome. By the way, UPDATE SET won’t work, update syntax is UPDATE {tabl_name} SET {col_name} = {value}, and optional WHERE clause., limit and order as usual

MySQL :: MySQL 5.0 Reference Manual :: 13.2.10 UPDATE Syntax

I’m pretty shitty at this stuff, could you write an example for me? It would be very helpful. I honestly don’t know how to make it select anything with a particular word in the name.

SQL Tutorial

ps. if you want to mach anything with ‘Deadly Gladiator’ in name do not use WHERE name = ‘xxx’, use LIKE.

mysql>UPDATE `item_template` SET {-put your values here--} `name` LIKE 'Deadly Gladiator%';

Also, post in the right section. Anyway, in answer to your question:

Let’s assume the field name you want to decrease is ArmorValue, you would simply multiply it by .85 as follows:

[CODE]
– NOTE: This is only an example, it will not actually work because the field names are made up

UPDATE item_template SET ArmorValue = (ArmorValue * 0.85) WHERE ItemName = ‘Deadly’;
[/SQL][/CODE]

Now, if you want to change everything with the word ‘Deadly’ in it, you can use the wildcard: %

[ul][li]The wildcard matches things depending where it is located:[/li][list]

[li]‘%Deadly%’ - matches everyting with the word ‘Deadly’ in it[/li]
[li]‘%Deadly’ - matches everything ending with the word ‘Deadly’[/li]
[li]‘Deadly%’ - matches everything starting with the word ‘Deadly’[/li]
[/ul]

[/list]

[SQL]
– NOTE: This is only an example, it will not actually work because the field names are made up

UPDATE item_template SET ArmorValue = (ArmorValue * 0.85) WHERE ItemName LIKE ‘%Deadly%’;
[/SQL]

Damn, I left my spoon in my other pants.

It’s ok, I think we’ve spoonfed this one enough.

On side note, you think the guys achieved hes goal? Looks like he doesnt walk to talk anymore ;/

Not even a “Thank you guys for doing my homework for me…”

Sorry guys. I had totally forgotten about this thread.

Thanks a bunch! :s

I ended up figuring it out myself, in the exact way MrSmite stated.

Thank you again!

Oh wow this is old. Sorry about the necro. :s

Nearly 1 year to say “thanks”, lol.