"je veux tous les identificateurs CIZA qui n'ont pas le bibcode 2002ApJ...580..774E"
Voici la démarche que j'ai suivi :
1 - je sélectionne tous les CIZA :
query select distinct id from identifier where id like 'CIZA%'
2 - de facon totalement indépendante, j'essaye de compter le nombre de fois où le bibcode
est dans la liste des bibcodes pour des objets tirés au hasard :
query select count(*) from has_bib_ref, bib_ref, identifier where oidbibref = oidbib and identifier.oid4ref = has_bib_ref.oid4ref and id = 'CIZA J0649.3+1801' and bibcode = '2002ApJ...580..774E'
--> résulat = 1 (j'ai bien ce bibcode)
query select count(*) from has_bib_ref, bib_ref, identifier where oidbibref = oidbib and identifier.oid4ref = has_bib_ref.oid4ref and id = 'M 1' and bibcode = '2002ApJ...580..774E'
--> résultat = 0 (normal, ce bibcode n'est pas dans M 1)
3 - Maintenant, pour chaque objet obtenu en (1) je veux compter avec ma requete trouvée en (2) et avoir 0 :
on prend la requete (1), on ajoute la condition que le résultat de la (2) est = 0
et on relie les 2 requetes en remplacant le id = 'CIZA J0649.3+1801' dans la (2) par id1.oid4ref = id2.oid4ref :
select distinct id from identifier as id1 where id like 'CIZA%' and (
. . .
select count(*) from has_bib_ref, bib_ref, identifier as id2 where oidbibref = oidbib and id2.oid4ref = has_bib_ref.oid4ref and id1.oid4ref = id2.oid4ref and bibcode = '2002ApJ...580..774E') = 0