Remove characters in SQL database

Hello all.

My project involves an SQL database originally imported as JSON.

How do I remove all characters (with different lengths) before a specific character by query?

Example: column 1 has;

              abc/defg
              hijklmn/op
              qrst/uvwxyz

I want to remove all characters before the ‘/’ and have output as:

              /defg
              /op
              /uvwxyz

I tried the “TRIM()” function to no avail, so there may be something I’m missing.

Any help would be appreciated.

Thanks a lot.

SELECT SUBSTR(field, INSTR(field, '/')) FROM data LIMIT 0, -1

Thanks a lot Vladimir!

It worked.


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.