This topic created in 3345 days ago, the information mentioned may be changed or developed.
SELECT *,
( IF(LOCATE('腾讯', title), 4, 0) + IF(LOCATE('腾讯', content), 2, 0) + IF(LOCATE('逆市', title), 4, 0) + IF(LOCATE('逆市', content), 2, 0) ) AS score
FROM s_data
WHERE ( (title LIKE '%腾讯%') OR (content LIKE '%腾讯%') OR (title LIKE '%逆市%') OR (content LIKE '%逆市%') )
ORDER BY score DESC, created_at Desc LIMIT 10
1 replies 2017-03-31 15:59:26 +08:00