Consider the below sample table:
ID Value
123 ABC
456 DEF
456 ABC
I want the select query result as below:
ID Value
123 ABC
456 DEF
Note: ID has only 2 different values - "123" and "456". Selection should be based on Column "ID". If value "123" is present, the corresponding data from "Value" column has to be selected. If not "456" ID should be retrieved.