Do not select records that have the status = 'Off'

0
$query = "SELECT uf , count(*) as number FROM tab_clientes GROUP BY uf ";

It is working fine however I have in the database a status field that classifies the person as Off (need to remain registered for other reports).

I would like the records not to enter the above query when the status='Desligado' field.

    
asked by anonymous 19.01.2018 / 15:26

1 answer

1

Just use a where

$query = "SELECT uf , count(*) as number " .
         "FROM tab_clientes " .
         "WHERE status <> 'Desligado'" .
         "GROUP BY uf ";
    
19.01.2018 / 15:27