Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Delete last 5 characters in a string

I have a column with suburb names and postcodes – eg – MARLEY HEIGHTS 2067. I want to remove the last 5 characters and get the suburb name only. i.e., MARLEY HEIGHTS as the result. How can I do that in big query ?

I tried Rtrim(column,’ ‘) as suburb, but this did not work.

Any help would be greatly appreciated ! Thanks !

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

SUBSTR(string, 1, LENGTH(string) - 5)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading