November 3rd, 2012, 04:56 AM
Replace data using LEFT$() in mySQL DB
I need to find the letters "ABC" in the 'name' field of my 'products' table and change the 'price' to a new price for all records that match the "ABC" criteria.
i.e. IF LEFT$(name,"ABC") then set price = '1.99';
Can someone show me how to do this, please.
November 3rd, 2012, 07:04 AM
UPDATE my_table SET my_value = 1.99 WHERE my_string LIKE 'ABC%';
November 4th, 2012, 06:56 PM
Thanks very much CafeLatte. Much appreciated.
Originally Posted by cafelatte