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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -