I am working on a dataset that looks like this:
As a result of this query:
SELECT "campaign_1" campaign_name, 0 clicks, 5 impressions, 1000 cost UNION ALL
SELECT "campaign_2", 1, 5, 0 UNION ALL
SELECT "campaign_3", 0, 0, 0
My goal is to show all rows in this table that have at least 1 non-zero value. In other words, my desired output is:
To solve my own problem, I tried to use a big WHERE clause including names of every column, listing each in the following format: WHERE column_1 != 0 AND column_2 != 0 .... This didn't work, because it also eliminated first 2 rows, since they also contain 0s.
I have searched StackOverflow for existing answers to this problem, and while I found a solution to a similar problem by Mikhail Berlyant here, this particular solution does not apply to this scenario. Therefore, I posted this as a new question.
Thank you in advance for sharing your knowledge and your help!


