Click here to Skip to main content
15,898,688 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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
Posted
Comments
[no name] 24-Aug-14 11:36am    
You go read up on how to do a SUBSTRING in SQL.
prasanna.raj 24-Aug-14 11:55am    
http://www.tutorialspoint.com/sql/sql-string-functions.htm#function_substring

i refer this site but didn't get ans

1 solution

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)
SQL
SELECT SUBSTRING(SUBSTRING(MyColumn, CHARINDEX(' ', MyColumn) + 1, 2000), 0, CHARINDEX(' ', SUBSTRING(MyColumn, CHARINDEX(' ', MyColumn) + 1, 2000))) FROM MyTable
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900