geek2000 geek2000 - 1 year ago 94
SQL Question

Add a string to a specific location in Postgres

I need to add a dot in the 4th position of each string in a column. How can I perform this in Postgres?


should become

Answer Source

For example use left / right:

db=> select left('1234', 3) || '.' || right('1234', -3);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download