select t1.id from tabella t1 join tabella t2 on t1.id=t2.id where t1.valore=8 and t2.valore=14