Created
October 12, 2014 15:05
-
-
Save mewm/fb6481d6a457de9c81f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update table_with_posts p set col_to_update = ( | |
select | |
col_to_update_from | |
from | |
table_to_update_from | |
where | |
table_to_update_from.id in (<comma separated ids or select id statement) | |
order by rand() | |
limit 1 | |
) where id in (<ids to posts you wanna update>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment