ol30cean0
ol30cean0

Reputation: 501

UPDATE column where another column LIKE specific string

I tried to figure out how to do this, but no luck, so I am asking for help...

I have a table named products and I need to update in a column names refresh_time all rows that LIKE "-295" in another column named "ref"

I tried

UPDATE products SET refresh_time = "2014-10-26 08:33:29" WHERE products.ref LIKE "295-"

No luck..

any help is highly appreciated.. thanks in advance.

Upvotes: 0

Views: 256

Answers (1)

Denise Skidmore
Denise Skidmore

Reputation: 2416

You need a wildcard in your LIKE pattern. And use single quotes.

LIKE '295-%'

http://www.w3schools.com/sql/sql_like.asp

Upvotes: 1

Related Questions