This problem is giving me a headache. I have a column in PostgreSQL that is a string:
Example:
bpApx14L103
The characters have always the same structure, the first two letters meaning one thing, etc.
So the output should be into columns:
I can’t figure it out, thanks in advance.
>Solution :
You can use the substring() function:
select substring(the_col, 1, 2) as a,
substring(the_col, 3, 5) as b,
substring(the_col, 8, 1) as c,
substring(the_col, 9, 1) as d,
substring(the_col, 10, 1) as e,
substring(the_col, 11, 1) as f
from the_table
