SQL Server query to remove the last word from a string -


there's answer question in mysql tag. decided make lives easier , put answer below sql server users. happy see different answers perhaps better performance.

happy coding!

select substring(@yourstring, 1, len(@yourstring) - charindex(' ', reverse(@yourstring))) 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -