Posts
33
Comments
153
Trackbacks
0
August 2015 Entries
Remove all characters words after certain character word in SQL
If you want to get rid of all the data after certain word in SQL column, you can use the combination of LEFT and CHARINDEX function to achieve the desired result.

For example, if column consists of following data - 

Column1
-----------

tempdata1 tempdata2;tempdata3

and if you want to display only uptill the semicolon in result - then use the following query:

SELECT LEFT(Column1, CHARINDEX(';', Column1)-1)

RESULT

tempdata1 tempdata2


Posted On Friday, August 14, 2015 12:24 PM | Comments (0)