db script: remove duplicated records