Skip to content

Instantly share code, notes, and snippets.

@fulippo
Created September 28, 2012 14:48
Show Gist options
  • Save fulippo/3800324 to your computer and use it in GitHub Desktop.
Save fulippo/3800324 to your computer and use it in GitHub Desktop.
Update di una tabella con select sulla stessa tabella
UPDATE data_table t, (SELECT DISTINCT ID, NAME, VALUE
FROM data_table
WHERE VALUE IS NOT NULL AND VALUE != '') t1
SET t.VALUE = t1.VALUE
WHERE t.ID = t1.ID
AND t.NAME = t1.NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment