SELECT * FROM tbl_specialisation
WHERE LENGTH(spec_specialise) < 20 ORDER BY spec_specialise LIMIT 9
添加到此查询
答案 0 :(得分:0)
USE ORDER BY RAND()
$sql= "SELECT * FROM `tbl_specialisation`WHERE LENGTH(spec_specialise) < 20 ORDER BY RAND() LIMIT 9 ";
答案 1 :(得分:0)
您的问题不明确,因为您要求9个随机字段,但在SQL查询中,您尝试获取9条记录。如果您想从表中获得9条记录,请使用以下内容。
$sql= "SELECT * FROM `tbl_specialisation`WHERE LENGTH(spec_specialise) < 20 ORDER BY RAND() LIMIT 9 ";
答案 2 :(得分:0)
“SELECT * FROM tbl_specialisation
WHERE LENGTH(spec_specialise)&lt; 20 ORDER BY RAND()LIMIT 9”;