I'm querying the following table:
id | value | applicable |
---|---|---|
id1 | 5 | Unknown |
id1 | 5 | Unknown |
id1 | 6 | Yes |
id 2 | 5 | Unknown |
id 2 | 5 | No |
id 2 | 3 | Unknown |
I would like to replace all "Unknowns" in the applicable column, with the non-unknown values pertaining to each id.
Ideally, I would like to see this:
id | value | applicable |
---|---|---|
id1 | 5 | Yes |
id1 | 5 | yes |
id1 | 6 | Yes |
id 2 | 5 | No |
id 2 | 5 | No |
id 2 | 3 | No |
Sorry if this a very easy question, I'm new to this!
Thank you
Best Answer
This expects one one value besides of unknown, if this si not the case you must choose another aggregation function
db<>fiddle here