Fixed SQL on repeated data

Only insert new data into the DB