Display SQL results with specific field filters

0

I have SQL:

select id,disponibilidade,tipo from clientes where cliente = '$cliente' AND status = '2' AND tipo = '0' OR disponibilidade <> '0' OR vanual <> '0' OR vtemporada <> '0'

You have to return a record if the type field is zero and if all the availability , vanual and / strong> are zero. But ... it will not return a record if the type capo is nonzero and also if any of the fields like availability , vanual timetable are nonzero.

But I can not do it!

    
asked by anonymous 15.03.2016 / 15:58

1 answer

0

You have to return a record if the type field is zero and if all the availability, vanual, and time field are zero.

tipo = 0
disponibilidade = 0
vanual = 0
vtemporada = 0
RETORNA OK

But ... it will not return a record if the type capo is nonzero and also if any of the fields like availability, vanual and timeout are nonzero.

SELECT id,disponibilidade,tipo 
  FROM clientes 
 WHERE cliente = '$cliente' 
   AND status = 2 
   AND tipo = 0
   AND disponibilidade = 0 
   AND vanual = 0 
   AND vtemporada = 0

I just did not understand the "status" field, but it should work.

    
18.03.2016 / 03:41