Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Is there an SQL function to parse out characters in a string?

$
0
0

I have a column with characters like:

12345 AB 12345

12345 CD 12345

I just want just the "AB" and "CD" returned.

I tried this and can get only the first part trimmed off:

SELECT column,substring(docket,
                       charindex(' ',column)+1 ,
                       len(column)) as [column]

output:

AB 12345

CD 12345


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>