Log in

View Full Version : SQL Question


Envisage
07-28-2013, 11:00 PM
Is there way to change sellrate from the results of this query...?

SELECT id, Name, Price, sellrate FROM items WHERE Name LIKE 'Spell:%';

I was thinking to add set sellrate = 5 in but it didn't go as planned. Just curious.

Kingly_Krab
07-28-2013, 11:18 PM
Would you mind being a little more in depth before I write out a query that may not do the correct thing? You want to update all items with "Spell:" in the name to a sellrate of 5, yes?

Envisage
07-28-2013, 11:28 PM
Yes, thats exactly what I want to do.

lerxst2112
07-29-2013, 12:35 AM
Select is for querying information. You would need to use update to actually change it.

Something like:

update items set sellrate = 5 where name like 'Spell:%'