Skip to content
Advertisement

How to get first character-set of string in sql?

I want to get 202500 and 37500 without not adding removed characters (in eg: 7, 5). (ie. first string gp in columns).sample-image description here But, I don’t know to get string in front of blank string “”. I have a little exp in sql. pls show me ans.

Advertisement

Answer

Use SUBSTRING_INDEX instead

| ExtractString |
| :------------ |
| 202500        |

| ExtractString |
| :------------ |
| 37500         |

db<>fiddle here

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement