我正在使用MYSQL MYISAM和php版本5.4.16并且正在进行基于(product_name)列的全文搜索,我想将结果随机化,但问题是rand()没有给出随机值。
我试过这样的事情:
SELECT `product_name`,`main_cat_id`,`sub_cat_id`,`prod_cat_id`,`prod_short_desc`,`com_id`,`product_id`,product_ratings, `min_order_quantity`, `fob`,`country_id`,`company_name`,`attributes`,`attr_values`,`verify`,`image`,product_additionals , MATCH (`product_name`)AGAINST ('"girls top"'IN BOOLEAN MODE) AS relevance, MATCH (`product_name`)AGAINST ('girl* +top*'IN BOOLEAN MODE) AS relevance1 FROM pep_browse_com_prods WHERE (MATCH (`product_name`) AGAINST ('"girls top"'IN BOOLEAN MODE) OR MATCH (`product_name`) AGAINST ('girl* +top*'IN BOOLEAN MODE)) AND STATUS = '0' AND display = '0' ORDER BY relevance DESC,relevance1 DESC,RAND() limit 20
我想首先设置相关性然后我想要休息列的随机值。