Sql Delete Query With If Statement