user1010966
user1010966

Reputation: 513

How update columns that ends with particular text?

Suppose Table domains contains a cloumn 'dname'. It consists of 'india.com', russia.net', 'brazil.com', 'canada.biz' etc. I need to update table 'domain' where rows of column 'name' ends with .com. Please help

Upvotes: 1

Views: 55

Answers (3)

Hisham
Hisham

Reputation: 455

Use wild card in SQL for your refrence LINK

Upvotes: 1

Naveen Kumar Alone
Naveen Kumar Alone

Reputation: 7678

UPDATE domains SET col_name = 'column_value' WHERE dname LIKE '%.com';

Syntax for this one is

UPDATE table_name SET col_name = 'column_value' WHERE column_name LIKE '%___';

Upvotes: 1

Sashi Kant
Sashi Kant

Reputation: 13465

Try this::

update 
domain
set column='your value'
where 
`name` like '%.com'

Upvotes: 1

Related Questions