So I have a query that currently returns a table of 1s and 0s like the following
1 0 0
1 1 0
0 0 1
0 1 1
1 1 0
1 1 1
However, I would like to modify my query so that for rows with multiple 1s, we only keep the first 1 in the row. For example, I want to convert (1 1 1) to (1 0 0), (0 1 1) to (0 1 0), and so forth. It seems like IF logic would be a last resort.
What would you all recommend? Could I do a case statement where the value in one column depends on another columns value?
In other words, "COLUMN 2 = CASE WHEN COLUMN 1 = 1 and COLUMN 2 = 1, then 0...etc?"