mysql查询最新一组数据

public function getDetail(){
$sql = "SELECT * FROM (SELECT * FROM Z_CFTC_GOV_NEW ORDER BY UPDATETIME DESC) AS NEWS GROUP BY NAME";
$detail = $this->query($sql);
return $detail;
}



SELECT * FROM (SELECT * FROM posts ORDER BY dateline DESC) GROUP BY  tid ORDER BY dateline DESC LIMIT 10

链接:http://www.cnblogs.com/Alight/p/3425357.html
posted @ 2017-03-02 17:05  旧约yzy  阅读(4457)  评论(0编辑  收藏  举报