Make query not showing some results

Asked

Viewed 128 times

3

I have a table of CPF where the CPF’s registered. I need to make a SELECT where display all registered Cpfs, least 3 CPF’s.

Something like:

 SELECT * 
   FROM cpf 
  WHERE cpf_id <> '111.111.111.11,222.222.222.22,333.333.333.33';

What is the correct way to do this type of query?

1 answer

5

Use the NOT IN ().

SELECT * 
  FROM cpf 
 WHERE cpf_id NOT IN ( '111.111.111.11'
                      ,'222.222.222.22'
                      ,'333.333.333.33');

Browser other questions tagged

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