Help with Query without showing all the results

0

Good day, I have a little doubt, I hope you can support me.

I'm doing a query in a DB, with the following code:

select status as EstatusReporte, count (status) as TotalReportes 
  from Reportes 
  where CveAuxiliar = Numero 
  group by Status

In which I have as a result:

EstatusReporte    TotalReportes
EN PROCESO           5
NEUTRO               3
RESUELTO             5

I would like to make the same query but without showing NEUTRAL, that the result is like this:

EstatusReporte    TotalReportes
EN PROCESO           5
RESUELTO             5

Someone who can support me, thank you very much!

    
asked by Alberto Hernández 19.10.2018 в 17:42
source

2 answers

2

Just add what status is different from neutral

select status as EstatusReporte, count (status) as TotalReportes 
  from Reportes 
  where CveAuxiliar = Numero 
  and where status <> 'NEUTRO'
  group by Status
    
answered by 19.10.2018 в 17:46
0

just filter NEUTRAL in your query ...

select status as EstatusReporte, count (status) as TotalReportes from Reportes  where CveAuxiliar = Numero and status <> 'NEUTRO' group by Status
    
answered by 21.10.2018 в 00:50