Come hai strutturato le tabelle? Che errore ti da? come fai a capire che si blocca al primo and?