Mysql
 sql >> Database >  >> RDS >> Mysql

inserisci in select su query mysql duplicata

Potresti provare :

INSERT INTO backup_prochart.symbol_list (ticker, end_date, cur_date) 
SELECT ticker, end_date, cur_date FROM prochart.symbol_list WHERE ticker = 'MAY17' 
ON DUPLICATE KEY UPDATE end_date = values(end_date), cur_date = values(cur_date);

Ovviamente la colonna "ticker" deve essere definita univoca per la tabella "backup_prochart.symbol_list".