SELECT * FROM (
SELECT a.`date`, a.status, p.id_people, i.name, i.surname, i.main, p.high, 
p.eyes_color, g.name AS `group name`, t.name AS `target name`, t.`exists`, w.name AS `weapon name`, w.power, w.range, w.accuracy  
	FROM `attack` AS a
 		LEFT JOIN `people` AS p ON a.id_people=p.id_people
		LEFT JOIN identity AS i ON i.id_people=p.id_people
		LEFT JOIN `group` AS g ON a.id_group=g.id_group 
		LEFT JOIN `target` AS t ON a.id_target=t.id_target 
		LEFT JOIN `weapon` AS w ON a.id_weapon=w.id_weapon
	ORDER BY i.main DESC
) AS q GROUP BY id_people;
