如何提取字符串SQL [英] How to Extract string SQL
本文介绍了如何提取字符串SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
全部
我尝试更多获取提取字符串
EX:
'Abile Techologies PvtLtd'
i想得到Techologies,如何为此编写查询
谢谢
Hi, All
I try to more to get extract string
EX:
'Abile Techologies PvtLtd'
i want to get Techologies, how to write query for this
Thanks
推荐答案
问题是SQL字符串处理非常糟糕:如果要将其检索为表示语言在那里你会做得更好:它更容易,更清洁,更容易维护。
但是你可以这样做:你需要使用嵌套的子串, (并希望您的数据格式相同)
The problem is that SQL string handling is pretty poor: if you are retrieving this into a presentation language, you would be much better off doing this there: it's easier, cleaner and much easier to maintain.
But you can do it: you need to use nested substrings, (and hope that your data is all the same format)
SELECT SUBSTRING(SUBSTRING(MyColumn, CHARINDEX(' ', MyColumn) + 1, 2000), 0, CHARINDEX(' ', SUBSTRING(MyColumn, CHARINDEX(' ', MyColumn) + 1, 2000))) FROM MyTable
这篇关于如何提取字符串SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文