如何通过sqlite查询的where子句进行排序。
例如:
-------------------------------------- | id | body | -------------------------------------- | 1 |the boy is going to bed | -------------------------------------- | 2 |the boy is good child | -------------------------------------- | 3 |the boy is playing the computer|
我的搜索输入是:
"the boy is going to bed"
所以我的SQL查询将是。
select * from data
where body like '%the%' or like '%boy%' or like '%is%'
or like '%going%' or like '%to%' or like '%bed%'
我希望id 1是第一个,因为它有很多正确的where子句。