This is the query I want to make: -- Obtain the name, telephone number, comments and duration of the visit of the visitors Lorea and Ramón.
SELECT vi.Nombre, vi.NO_Móvil, ci.Duración, re.Observaciones
FROM Visitante vi
JOIN Citaprevia ci ON vi.DNI=ci.fk_DNI
JOIN Registrovisita re ON re.fk_Cod_Visita=ci.Cod_Visita
WHERE ci.Cod_Visita='1' AND ci.Cod_Visita='2';
It doesn't give me an error, it just returns an empty response. When I remove the AND from the WHERE condition and the second, condition gives me the first answer (which is related to Lorea).
Thank you very much