I have a database table Tb1 with n columns and m count of rows.
Tb1 ======================================== field_0... field_k... field_p... field_n
Here is the pseudo-code that I need to express in SQL
if(count(select distinct Tb1.field_k) > 1) return "string_literal" else return Tb1.field_p
The result set should have m count of rows.
Notes: