TSQL how to remove all characters or text after the last tab space -


I have some data that looks like this:

  Maple Leaf City   

This is in a single column called City.

I want to remove the word city so that the output looks like this:

  maple << code>   

The code removes everything after the first place rather than the last place.

How do I do this: Maple Leaf City and change it to Maple Leaf

What is:

  SELECT LEFT (city, CHARINDEX ('', city) - 1) Where the Chardix ('', city) & gt; 1   

My code gives me this: Maple

  declare @ root varchar (255) set @tr = 'maple leaf city' LEFT (@str, ln (@rr) - charxx ('', river (@rrt)) < / Code>   

Comments

Popular posts from this blog

c++ - Cmake produces file extensions in static library archives -

c# - Roxy file manager in MVC doesn't accept session path -

c# - Check if a NumericUpDown has no value -