我的查询如下:
$query = "SELECT report,";
$query.= "GROUP_CONCAT(DISTINCT analyst) AS analysts, ";
$query.= "GROUP_CONCAT(DISTINCT region) AS regions, ";
$query.= "GROUP_CONCAT(DISTINCT country) AS countries, ";
$query.= "GROUP_CONCAT(DISTINCT topic) AS topics, ";
$query.= "GROUP_CONCAT(DISTINCT date) AS dates, ";
$query.= "GROUP_CONCAT(DISTINCT link) AS links, ";
$query.= "GROUP_CONCAT(DISTINCT province) AS provinces ";
$query.= "FROM reports GROUP BY report ORDER BY dates DESC ";
我想要MySQL到GROUP BY报告,并且还要将(报告的)数量限制为10.任何建议?
答案 0 :(得分:2)
只需将LIMIT 10
添加到查询的末尾即可。