I have string column in a table, its length can be different and delimited by /, examples below. I am trying to remove any last characters after last / sign, including last / sign. Any ideas would be appreciated, I haves tried left, charindex, etc options but no luck. Reason to remove is so that I can do join with other table to find values.
Source:
Sh/cm/rq;
Sh/nj/mdr/wep;
Sh/kl/uhj/tyu bh/red
Looking to output
Sh/cm;
Sh/nj/mdr;
Sh/kl/uhj/tyu bh
I haves tried left, charindex, etc options but no luck.
Source:
Sh/cm/rq;
Sh/nj/mdr/wep;
Sh/kl/uhj/tyu bh/red
Looking to output
Sh/cm;
Sh/nj/mdr;
Sh/kl/uhj/tyu bh
Try this