I want to select a field from table and substring it.
For example:
VAN1031 --> 1031
I tried this, but is improper syntax:
<
Sometimes you need to catch the column without some last characters. For example, I have:
This is a string
Let's say that for some reason I want column without last 6 characters:
This is a
We can do (using @bluefeet 's answer and LENGHT):
select substring(col1, 1,LENGTH(col1)-7)
from table1
It was only an example, but you got the idea, I'm using to fix a wrong database import.