Assuming this is my table:
email | col1 | col2
------+-------+------
a@a | 1 | 0
a@a | 0 | 1
b@b | 0 | 1
c@c | 1 | 0
I’m trying to update each row where email has more than one of the same entry. In the table above a@a is listed twice with a 1 in col1 and in the next record a 1 in col2. I’d like a single record for a@a with a 1 in both col1 and col2. and then I can remove duplications afterwards.
I should then be left with a table where only in record exists for each email and I can then filter on having 1 in col1, col2 or both.
I’ve tried sorting this data using group by email having col1 = 1 and col2 = 1, but that won’t work (presumably it only filters on the first record found, not a combined subset of the data – makes sense).
I’m sure this is an easy one and I’m just having another one of those days, any help appreciated.
would this help: