1 2 3 4 5
USE plato; INSERT INTO Output WITH (MONOTONIC_KEYS, TRUNCATE) SELECT * FROM Input ORDER BY key, subkey;