SELECT id, str1, SUBSTRING(str1,12,1) concat '-' concat str1 as str2 from t10k UNION ALL SELECT 10000 + id, str1, SUBSTRING(str1,13,1) concat '-' concat str1 as str2 from t10k UNION ALL SELECT 20000 + ...