How do you order the MySQL sentence?
SELECT * from the text where (' title ' like '% of us% ' and ' title ' like '% of them% ') or (' title ' like '% US% ' or ' title ' like '% of them% ') Lim It 6
Is there a way to first put the previous condition (' title ' like '% of us% ' and ' title ' as '% of them% ') listed to come up in the list below?
------Solution--------------------
Give it a try?
SQL code
select *, ((' title ' like '% US% ' and ' title ' like '% of them% ') * 0.8 + (' title ' like '% of us% ' or ' title ' like '% of them% ') * 0.2) as Relevancefrom textwhere (' title ' like '% US% ' and ' title ' L Ike '% of them% ') or (' title ' like '% of us% ' or ' title ' like '% of them% ') ORDER by relevance Desclimit 6
------Solution------------------ --
SQL code
select * FROM (SELECT * from ' text ' WHERE ' title ' like '% of us% ' and ' title ' like '% of them% ') Ttwhere ' title ' like '% of us% ' or ' title ' like '% of them% ' limit 6;
------Solution--------------------
SQL code
selec T *, 1 as XH from the text where (' title ' like '% of us% ' and ' title ' like '% of them% ') Unionselect *, 2 as XH from text where (' title ' Like '% we% ' or ' title ' like '% of them% ') Order by Xhlimit 6