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

Asked

Viewed 39 times

0

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

It is working perfectly but I have in the bank a status field that classifies the person as Off (need to continue registered for other reports).

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

1 answer

1


Just use a where

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.