0

I have a many rows which contains different value for different columns , but i have only one column - DATA , how can i find specific column value in the row , it looks like

14000000PA1420000000PMP1 14200003093090006185211010012  240614000000250614  BUDAPEST        VODAFONE POSTPAID PAYM   2030001025010000002660000348HUFFORINT                                   2506144261230042061365   0000000050   000000266000034800000026600003480000002660000348DALLOS SZILÁRD          022220049111250507201406250 000000266000042612314176001    000490836HU739900000000125050140625                              fcbmc22.176

For example i need third column , it means 14200 (10 position to 15 position)

I know about SUSBSTR , but its different position in other rows , so i dont know every position ,

thank you.

Cfreak
  • 19,191
  • 6
  • 49
  • 60
  • 1
    Is that one row of data shown in your question? – Ed Gibbs Aug 28 '14 at 13:56
  • To get a piece of the column you can the Oracle [`SUBSTR`](http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions162.htm) function (the link is for Oracle 10 docs, but it's the same for 11 and 12). – Ed Gibbs Aug 28 '14 at 13:59
  • "but its different position in other rows , so i dont know every position". If its not fixed width columns or delimited, is there any structure to this? If not, I'm not sure how you'll know where the "third column" is. – tbone Aug 28 '14 at 14:17

2 Answers2

0

Third_column := substr(your_string, 11, 5)

Egor Skriptunoff
  • 23,359
  • 2
  • 34
  • 64
0

Seems to be a simple substring question...

Select substr('14000000PA1420000000PMP1 14200003093090006185211010012 240614000000250614 BUDAPEST VODAFONE POSTPAID PAYM 2030001025010000002660000348HUFFORINT 2506144261230042061365 0000000050 000000266000034800000026600003480000002660000348DALLOS SZILÁRD 022220049111250507201406250 000000266000042612314176001 000490836HU739900000000125050140625 fcbmc22.176',11,5) as Col3
FROM DUAL;

Yields:

Col3
14200
xQbert
  • 34,733
  • 2
  • 41
  • 62