Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
想象一下,我有一个包含如下几条记录的表:
zare azre arze arez
我想找到包含'z'但如果我在这些记录中搜索的记录首先找到'zare'因为以开头'z',第二次找到'azre'因为z是第二个字母等等
'z'
'zare'
'azre'
z
你可以试试这个:
SELECT * FROM tbl WHERE col LIKE '%z%' ORDER BY CHARINDEX('z', col)