insert into realtable select temptable.* from temptable, realtable leftouter join temptable.ID on realtable.ID