正在搜索像facebook这样的SQL查询 [英] Searching Query for SQL like facebook

查看:104
本文介绍了正在搜索像facebook这样的SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



搜索像Facebook这样的sql数据库表的查询





如果用户搜索LOERUM ISPUM这样的名称,我想查询,然后先找到完全匹配,然后再搜索最少的匹配



--- -----------------------------------

ID Name

1 | Loerum Ispum

2 | Loerum是

3 | Loerum



我希望这个层次结构用于我的搜索,我已经使用了LIKE关键字但它没有生成所需的序列请为我写一个查询,在此先感谢


Searching query for sql database table like Facebook


I want to make a query if a user searches for a name like "LOERUM ISPUM" then the exact match comes first and then the least matches comes later

--------------------------------------
ID Name
1 | Loerum Ispum
2 | Loerum Is
3 | Loerum

I want this hierarchy for my search , I have already used LIKE keyword but it does not makes a required sequence please write a query for me , thanks in advance

推荐答案

您正在寻找全文搜索 [ ^ ]。请按照链接阅读所有相关文章。
You are looking for full-text search[^]. Please, follow the link and read all related articles.


这篇关于正在搜索像facebook这样的SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆