Skip to content

Instantly share code, notes, and snippets.

@SputterPuttRedux
Last active November 11, 2015 21:26
Show Gist options
  • Save SputterPuttRedux/296e876ec1a274eb3e28 to your computer and use it in GitHub Desktop.
Save SputterPuttRedux/296e876ec1a274eb3e28 to your computer and use it in GitHub Desktop.
UPDATE call_source_partners
SET affiliate_slug = params_table.affiliate_slug, category_id = params_table.category_id
FROM (
SELECT id, params->'affiliate_slug' AS affiliate_slug, to_json(params->'category_id')::text::int AS category_id
FROM call_source_partners
) AS params_table
WHERE call_source_partners.id = params_table.id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment