allo stesso modo, ti memorizzi l'id che vuoi escludere. nella where aggiungi

... AND ID<>id_memorizzato...