2016-08-18 74 views

回答

0

「SELECT * FROM tbl_specialisation WHERE LENGTH(spec_specialise)< 20 ORDER BY RAND()LIMIT 9」;

0

使用ORDER BY RAND()

$sql= "SELECT * FROM `tbl_specialisation`WHERE LENGTH(spec_specialise) < 20 ORDER BY RAND() LIMIT 9 "; 
+0

tkz bro work –

+0

「SELECT dr_image,dr_name FROM tbl_doctors WHERE dr_image IS NOT NULL AND dr_name IS NOT NULL ORDER BY RAND() LIMIT 4;」這裏的非圖像字段是idont wand非圖像字段如何chnge查詢 –

+0

(「SELECT dr_image,dr_name FROM tbl_doctors WHERE dr_image!=''AND dr_name!=''ORDER BY RAND()LIMIT 4;」);這是codeigniter中的回答 –

0

你的問題是不明確的,因爲你是問9個隨機字段,但在SQL查詢,你試圖讓9條。如果你想從表中獲得9條記錄,然後使用以下內容。

$sql= "SELECT * FROM `tbl_specialisation`WHERE LENGTH(spec_specialise) < 20 ORDER BY RAND() LIMIT 9 "; 
+0

如何編寫此查詢? –

相關問題