Table Name: GLCC
Column Name: criteria
Column Value: ALAM-**-98000-10301990-***-***************-*****-OPR**
SELECT
criteria,INSTR(criteria,'-',1,1) AS first_comma,
INSTR(criteria,'-',1,2) AS second_comma,
INSTR(criteria,'-',1,3) AS third_comma
,INSTR(criteria,'-',1,4) AS fourth_comma,
INSTR(criteria,'-',1,5) AS fifth_comma,
SUBSTR(criteria,1,INSTR(criteria,'-',1,1)-1) column1
,SUBSTR(criteria
,INSTR(criteria,'-',1,1) + 1
,INSTR(criteria,'-',1,2)
- INSTR(criteria,'-',1,1)
- 1)
AS column2
,SUBSTR(criteria
,INSTR(criteria,'-',1,2) + 1
,INSTR(criteria,'-',1,3)
- INSTR(criteria,'-',1,2)
- 1)
AS column3
,SUBSTR(criteria
,INSTR(criteria,'-',1,3) + 1
,INSTR(criteria,'-',1,4)
- INSTR(criteria,'-',1,3)
- 1)
AS column4
,SUBSTR(criteria
,INSTR(criteria,'-',1,4) + 1
,INSTR(criteria,'-',1,5)
- INSTR(criteria,'-',1,4)
- 1)
AS column5
,SUBSTR(criteria
,INSTR(criteria,'-',1,5) + 1
,INSTR(criteria,'-',1,6)
- INSTR(criteria,'-',1,5)
- 1)
AS column6
,SUBSTR(criteria
,INSTR(criteria,'-',1,6) + 1
,INSTR(criteria,'-',1,7)
- INSTR(criteria,'-',1,6)
- 1)
AS column7
,SUBSTR(criteria
,INSTR(criteria,'-',1,7) + 1)
AS column8
FROM
glcc;