I have a name column like this:
Name
------
Roger
RogerMan
Roger That
I need a query which would return distinct initials from the column. For example, in this case I want to return:
Name
-----
R
RM
RT
I have tried a number of approaches for this: 1. CASE statement (works perfectly by far). 2. STRCMP 3. SUBSTRING
However, I am looking for a more dynamic approach using functions in Postgres.