Filter data in sql

0

I have a clientes table with columns:

nome
cidade
email1
email2

It's not all customers who have registered with email. How do I mount a sql statement where it only returns clients containing email1 or email2 ?

    
asked by anonymous 23.04.2018 / 15:41

1 answer

1

Try something like this:

SELECT
nome, cidade, email1, email2 
FROM
clientes
WHERE
(email1 is not null and email1 <> '') OR (email2 is not null and email2 <> '')
    
23.04.2018 / 15:56