简体   繁体   中英

How to select specific value for certain column in one SQL ROW

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.

Third_column := substr(your_string, 11, 5)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM