0

I have a table containing column image. In image column values are stored like abc.png,xyz.png,agh.png. Now i want to update the column with xyz.png,agh.png. i used following code. but its not working. Please help me. your help would be appreciated.

update table set images=(select REPLACE(images,'45021.jpg',' ') from table where id='6') where id='6'

sql is showing following error : You can't specify target table 'table' for update in FROM clause

2 Answers 2

0

You don't have to make subselect for this.

UPDATE `table`
   SET `images` = REPLACE(`images`, '45021.jpg', ' ')
 WHERE `id`= 6
0
0

table is yourtablename??

 update tablename set images=REPLACE(images,'45021.jpg',' ') where id='6'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.