I am trying to get year (yyyy) from text/string in the column "title" but for some reason can't get following query to work:
select substring(title,LOCATE(REGEXP '[(][0-9]{4}[)]',title),4) from videos
title column has following values:
abc abc 2001 abc
xyz (2002) xyz
Any assistance will be appreciated.
REGEXPcan only be used to match patterns, not extract them. You will need to find another way. MySQL may not be the best place to scrub your data.tsql?