select col1,
case when col1 like '%AB%'
then substring(col1, charindex('AB', col1) + 3, charindex(' ', col1 + ' ', charindex('AB', col1)) - charindex('AB', col1) - 3)
end,
case when col1 like '%CD%'
then substring(col1, charindex('CD', col1) + 3, charindex(' ', col1 + ' ', charindex('CD', col1)) - charindex('CD', col1) - 3)
end,
case when col1 like '%EF%'
then substring(col1, charindex('EF', col1) + 3, charindex(' ', col1 + ' ', charindex('EF', col1)) - charindex('EF', col1) - 3)
end
from tbl
KH
Time is always against us