select rn. from roundnumbers rn
where not exists ( select from rounds where rounds.numberid = rn.id )
and not exists ( select * from roundnumbers rnsub where rnsub.previousid = rn.id)
order by rn.competitionid;
delete from roundnumbers
where not exists ( select from rounds where rounds.numberid = roundnumbers.id )
and not exists ( select from roundnumbers rnsub where rnsub.previousid = roundnumbers.id);
select rn. from roundnumbers rn where not exists ( select from rounds where rounds.numberid = rn.id ) and not exists ( select * from roundnumbers rnsub where rnsub.previousid = rn.id) order by rn.competitionid;
delete from roundnumbers where not exists ( select from rounds where rounds.numberid = roundnumbers.id ) and not exists ( select from roundnumbers rnsub where rnsub.previousid = roundnumbers.id);
dit zou niet mogen voorkomen