【发布时间】:2014-08-10 06:54:30
【问题描述】:
我在表CurrentOrders 中有一个列ClientInformation,其中包含一个竖线分隔的字符串:
5275=7147|109=62F36|5075=BCRM|12221=PortwareALGO1
每个number= 都是一个FIX 标记,我想将其命名为自己的列,并且需要能够在SELECT 语句和WHERE 子句中使用。
我破解了一些东西,让我可以识别我需要的行,但我不能在 SELECT 或 WHERE 中使用...
(LEFT (RIGHT(ClientInformation, ( LEN(ClientInformation) - (PATINDEX('%109=%',ClientInformation) + 3) )),
PATINDEX('%|%', RIGHT(ClientInformation, ( LEN(ClientInformation) - (PATINDEX('%109=%',ClientInformation) + 2) ))) -2))as AccountID
我假设我需要将每个 number= 分解到我表中自己的临时列中,但我很难找到可以遵循的解释。
所以,我希望这些值中的每一个如下:
5275=7147|109=62F36|5075=BCRM|12221=PortwareALGO1
5275= as ClientBook
109= as AccountID
5075= as Broker ID
12221= as RouteTrace
【问题讨论】:
-
忽略,我现在看到它是用于 SQL Server (patindex)
标签: sql sql-server pipe extraction delimited