remove invalid shares with one SQL statement