Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

copy data from one field to another mysql mulitple rows

Tags:

mysql

I want to copy data from one field to another mysql mulitple rows.

I've tried following but its not working for all and mysql even says "returns more than 1 row"

UPDATE agreement 
SET _date2 = (SELECT Concat(SUBSTRING(_date, 7), '-', SUBSTRING(_date, 4, 2), 
    '-', SUBSTRING(_date, 1, 2)) AS newdd FROM   agreementtemp); 
like image 489
wajid afridi Avatar asked Dec 05 '22 22:12

wajid afridi


1 Answers

try

update `table_name` set  destination_field=source_field
like image 111
Maged Samaan Avatar answered Dec 10 '22 10:12

Maged Samaan