SELECT utente, evento FROM tabella X WHERE X.evento = A AND EXISTS ( SELECT 1 FROM tabella Y WHERE X.utente = Y.utente AND Y.evento = B )