codigo_socio
is in the table borrowed it stays without showing to the user and list the rest of requests that are not in the table loaned but in solicitaçãoemprestimo
.
EMPRESTADOS
codemprestados
dataemprestimo
horaemprestimo
solicitacaoemprestimo_socio_codigo
SOLICITACAOEMPRESTIMO
codemprestimo
dataemprestimo
horaemprestimo
socio_codigo
I'm trying to do this:
select se.* from solicitacaoemprestimo se
left join emprestados e on e.solicitacaoemprestimo_socio_codigo = se.socio_codigo
where e.solicitacaoemprestimo_socio_codigo = '41';
But this field that is inside the loan, I wanted it not to bring the item but rather to filter what is already in the table borrowed. Thank you in advance.