简体   繁体   English

Tibco Spotfire-文本功能问题

[英]Tibco Spotfire - Issue with text functions

I have a column that is prefixed with OIR$ then a last name. 我有一列以OIR$为前缀的姓氏。 How do I get rid of the OIR$ ? 如何摆脱OIR$

I've tried using RIGHT() but the names are of different lengths, so if I use Right([column.name], 10) then I will get some names correct and others will still have the unwanted letters of OIR$ . 我尝试使用RIGHT()但是名称的长度不同,因此,如果我使用Right([column.name], 10)那么我会得到一些正确的名称,而其他名称仍会带有不需要的OIR$字母。

Maybe: 也许:

SUBSTRING([column], 5, LEN([column]))

RIGHT([column], LEN([column]) - CHARINDEX('$', [column]))

REPLACE([column], 'OIR$', '')

eg 例如

declare @x varchar(20);
SELECT @x = 'OIR$testing';

SELECT SUBSTRING(@x, 5, LEN(@x))
testing

SELECT RIGHT(@x, LEN(@x) - CHARINDEX('$', @x))
testing

SELECT REPLACE(@x, 'OIR$', '')
testing

EDIT: It's not SQL. 编辑:这不是SQL。 Maybe https://docs.tibco.com/pub//spotfire/5.5.0-march-2013/UsersGuide/ncfe/ncfe_text_functions.htm 也许https://docs.tibco.com/pub//spotfire/5.5.0-march-2013/UsersGuide/ncfe/ncfe_text_functions.htm

RXReplace([column], "OIR$", "", "")
Mid([column], 5, Len(column))
declare @x varchar(20);
SELECT @x = 'OIR$testing';

SELECT SUBSTRING(@x, 5, LEN(@x))
testing

SELECT RIGHT(@x, LEN(@x) - CHARINDEX('$', @x))
testing

SELECT REPLACE(@x, 'OIR$', '')
testingd

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

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