Filter data in sql

Asked

Viewed 38 times

0

I have a table clientes with the columns:

nome
cidade
email1
email2

Not all customers have registered email. How do I set up an instruction sql where only returns customers that contain email1 or email2?

  • tried something already?

1 answer

1


Try something like that:

SELECT
nome, cidade, email1, email2 
FROM
clientes
WHERE
(email1 is not null and email1 <> '') OR (email2 is not null and email2 <> '')

Browser other questions tagged

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