Skip to content

Instantly share code, notes, and snippets.

@mdornseif
Created December 25, 2010 10:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdornseif/754805 to your computer and use it in GitHub Desktop.
Save mdornseif/754805 to your computer and use it in GitHub Desktop.
Dedutpe Table buchdurchschnittspreis2
DELETE FROM buchdurchschnittspreis2
WHERE id in
(SELECT buchdurchschnittspreis2.id FROM buchdurchschnittspreis2
LEFT OUTER JOIN (select min(id) as id from buchdurchschnittspreis2
GROUP BY (artnr, datum) as KeepRows
ON buchdurchschnittspreis2.id=KeepRows.id
WHERE KeepRows.id IS NULL);
@a613
Copy link

a613 commented Aug 25, 2014

Syntax error (mismatched parentheses)

@omarzina
Copy link

omarzina commented Jul 8, 2015

DELETE FROM buchdurchschnittspreis2
WHERE id in
(SELECT buchdurchschnittspreis2.id FROM buchdurchschnittspreis2
LEFT OUTER JOIN
(select min(id) as id from buchdurchschnittspreis2
GROUP BY (artnr, datum)) as KeepRows
ON buchdurchschnittspreis2.id=KeepRows.id
WHERE KeepRows.id IS NULL);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment