搜索列表排序问题

来源:百度知道 编辑:UC知道 时间:2024/06/01 03:41:28
搜索列表排序问题
将关键字(word)在数据表中查找,先按照标题(title)查找,然后按照标签(tag)查找
如何写该Sql?
Sql = "Select * From db Where title Like '%word%' or tag Like '%word%'"
Order By 怎么写?
用 order by title asc ,这不是按照 title 编码正续排吗?我想要关键字匹配程度之类的排序。
求asp搜索关键字匹配排序。

在建一个字段,保存匹配程度,然后再按照匹配程度排序!

order by DESC或者ASC呀
前一个是降序,后一个是升序

order by 写在后面就可以了 如

Sql = "Select * From db Where title Like '%word%' or tag Like '%word%' order by title desc,tag asc"

楼上正解