比如 一個公司員工參與的項目數(shù)量按降序或者升序排列后 輸出參與最多項目的前5%或者最少的前5%的人員名單select *from table_name order by Project_num desc limit 0, count(empNum)*0.05unionselect *from table_name order by Project_num asc limit 0, count(empNum)*0.05;我知道這里limit函數(shù)要求返回的是2個整數(shù)變量 我這樣弄第二個變量有可能是小數(shù),所以具體應該怎么弄?。?
在mysql中 我想用limit輸出前5%怎么出?
慕尼黑5688855
2019-01-01 15:06:11