Skip to content

Instantly share code, notes, and snippets.

@montogeek
Last active January 4, 2016 07:49
Show Gist options
  • Save montogeek/8591575 to your computer and use it in GitHub Desktop.
Save montogeek/8591575 to your computer and use it in GitHub Desktop.
select personas_23_dic.updated_at as OLD, personas.updated_at as NEW
from personas_23_dic
join personas
where personas_23_dic.id = personas.id
and DATE(personas.updated_at) = '2013-12-24'
order by personas.updated_at asc
// UPDATE
UPDATE personas NUEVA
left join personas_23_dic VIEJA ON
NUEVA.id = VIEJA.id
set
updated_at = if(DATE(personas.updated_at) = '2013-12-24', personas_23_dic.updated_at, personas.updated_at)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment