-2

I have :

953-UL_CPLX_7th-CRL_PD_GPON_O as string:

In mysql:
SPLIT_STR('953-UL_CPLX_7th-CRL_PD_GPON_O', '-', 1)

So I need to split (-) to return 953 in sqlite

1 Answers1

1

This is how I would do it in SQLite:

SELECT SUBSTR('953-UL_CPLX_7th-CRL_PD_GPON_O',1, INSTR('953-UL_CPLX_7th-CRL_PD_GPON_O', '-')-1)

This will return any number of characters before the first "-" character.

Dharman
  • 30,962
  • 25
  • 85
  • 135