我需要在 SQL 中找到两个字符串的公共子字符串(不带空格)。
询问:
select *
from tbl as a, tbl as b
where a.str <> b.str
Run Code Online (Sandbox Code Playgroud)
样本数据:
str1 | str2 | max substring without spaces
----------+-----------+-----------------------------
aabcdfbas | rikcdfva | cdf
aaab akuc | aaabir a | aaab
ab akuc | ab atr | ab
Run Code Online (Sandbox Code Playgroud)