The Home Depot Interview Question

Removing duplicate record using query