I’m working in MySQL Pro (5.5.9).
I’m trying to get the year from a column (Game_ID) in my table Games. Unfortunately, the year is surrounded by three characters and then followed by 5 integers. Ex:
SEA200110170
I would ideally be able to keep Game_ID intact, and then create a new column with only the year. So I would remove SEA (or another string of three characters) at the beginning and the string of five integers at the back, and be left with 2001 in a new column titled year_ID.
Any ideas?
I think it’s got to do with the trim function, but I haven’t been able to figure it out.
Try:
It returns the substring from position 4 through 8.