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

sql - VB.NET Operand type clash: date is incompatible with int error -

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

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -