思路:将t_test分成2个表,a表保留原来的数据。b表根据条件查出最新的name和create_time,再将b的name和create_time作为和a表的条件关联,即可查出:t_test表所有字段,且按照name分组,获取的最新记录
SELECT a.* FROM t_test AS a,
(SELECT b.`name`, MAX(b.create_time) AS `create_time` FROM t_test AS b GROUP BY b.`name`)
AS c WHERE a.`name`=c.`name` AND a.create_time = c.create_time ;