0
I need to make a select in my same database is below:
select
*
from tbl_frete f
join tbl_transportador t on f.idtransportador = t.idtransportador
join tbl_cliente c on f.idcliente = c.idcliente
join tbl_situacaofrete s on f.situacaofrete = s.idsituacao
where f.idcliente = 1
and f.situacaofrete = 0
and f.situacaofrete = 1
order by f.idfrete
but returns nothing, and when I do select so:
select
*
from tbl_frete f
join tbl_transportador t on f.idtransportador = t.idtransportador
join tbl_cliente c on f.idcliente = c.idcliente
join tbl_situacaofrete s on f.situacaofrete = s.idsituacao
where f.idcliente = 1
order by f.idfrete
returns the data but not as I wanted, since it does not return the freight with situation 1
How do I do this AND?
On the first command, you’re saying you want to
f.situacaofrete = 0 and f.situacaofrete = 1
. Try to take out the first part of the condition (f.situacaofrete = 0
)– Leonardo Pessoa
@Leonardopessoa but then those who have situation = 0 do not appear
– Joao Pedro
there are situations from 0 to 3, I want 0 and 1 to appear
– Joao Pedro
example has quite down there, I hope it helps you
– Rovann Linhalis