In order to convert the column to Title case or proper case in postgresql we use INITCAP() function. INITCAP function in postgresql converts string column to proper case. Let’s see how to
- Convert column to Title case or proper case in postgresql
Syntax of INITCAP():
INITCAP()
We will be using states table.
Convert column to title case or proper case in postgresql:
INITCAP() function converts the column to proper case in postgresql
select *, INITCAP(state_name) as proper_state from states
We have converted the state_name column to proper case. So the resultant table will be