I have a table with a few rows. I need to check: if all the values in the column index are equal then get three columns with unique values, If values are not equal then get an empty table. For example if index are equal: Input
index Product Version
10 A 2.5
10 A 2.5
10 A 2.5
Output
index Product Version
10 A 2.5
For example if index are not equal: Input:
index Product Version
10 A 2.5
11 B 3.3
10 A 2.5
10 A 2.5
Output
index Product Version
I tried to do that with "Case When" statement, but "Case When" can return only single column. Is there a way to compare values in a column and return several columns?