Skip to content

Instantly share code, notes, and snippets.

@pmdgithub
Created November 12, 2010 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmdgithub/674121 to your computer and use it in GitHub Desktop.
Save pmdgithub/674121 to your computer and use it in GitHub Desktop.
UPDATE zpmdl_pclaim zcp
SET mtm_drug_id = ydrg.id
FROM
(SELECT z.ndc, MAX(z.id) AS id
FROM drugs z
GROUP BY z.ndc) ydrg
WHERE ydrg.ndc = zcp.product_service_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment