I have a table like this
ID COACODE
-------------------
1 10200001
I want select statement split it like
ID BR DEPT MINS
-------------------
1 10 2000 01
I have a table like this
ID COACODE
-------------------
1 10200001
I want select statement split it like
ID BR DEPT MINS
-------------------
1 10 2000 01
use SUBSTRING()
The SUBSTRING functions allows you to extract a substring from a string.
NOTE: its works on when each row have same length of value otherwise it makes error
SELECT ID,SUBSTRING(COACODE, 1, 2) as BR , SUBSTRING(COACODE, 3, 6) as DEPT , SUBSTRING(COACODE, 7, 8) as MINS from table_name