简体   繁体   English

如何为一个SQL ROW中的某些列选择特定值

[英]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 我有很多行,其中的不同列包含不同的值,但是我只有一个列-DATA,如何在行中找到特定的列值,看起来像

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) 例如我需要第三列,它表示14200(10位到15位)

I know about SUSBSTR , but its different position in other rows , so i dont know every position , 我知道SUSBSTR,但是它在其他行中的位置不同,所以我不知道每个位置,

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL - 如何在特定列中选择具有最大值的数据行? - SQL - How to select data row with Maximum value within a specific column? 如何在SQL中每列值仅选择一行? - How to select only one row per column value in SQL? SQL Select 行,最大值在一列 - SQL Select row with max value in one column 选择SQL中在一行中具有列值而不在另一列中具有特定其他列值的值 - Select values in SQL that have a colum value in one row and not a specific other column value in another SQL Select 行,其中列具有一定的长度和最大值 - SQL Select row where column has certain length and max value SQL:选择至少一行具有特定值的不同“类别” - SQL: Select distinct “categories” with at least one row with a certain value 如何按SQL SELECT语句中的特定列计数记录并将该值放在该行的另一列中 - How to count record by specific column in SQL SELECT statement and putting that value in another column of that row 当另一行具有相同的 id 但列中的值不同时,如何在 SQL 中选择一行? - How do I select one row in SQL when another row has same id but a different value in a column? SQL:选择最近的日期时间行以及特定的列值 - SQL : Select the nearest datetime row along with specific column value 在特定列SQL Server中选择具有最大值的行 - Select the row with the max value in a specific column, SQL Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM