insert - MySQL how to take data from one column and put to another column under same ID and same table -


i have table products 3 columns

id   merchant   selected (empty column) 1    roger 2    anthony 3    maria 4    joseph 5    serge 

i want make query (syntax wrong, idea explain try do)

select * merchant '%thon%' products.merchant  insert products.selected 

but place same id row, result should this

id   merchant   selected 1    roger 2    anthony    anthony 3    maria 4    joseph 5    serge 

would obliged hint how make such trick !

the query of @kickstart , @daghan correct:

update products set selected = merchant merchant '%thon%' 

but have suggestion structure of table,if want make on of row selected, can change type of select column tinyint or boolean , table this:

id   merchant   selected 1    roger 2    anthony    1 3    maria 4    joseph 5    serge 

this write easier query, , final query sth :

update products set selected = 1 merchant '%thon%' 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -