SELECT
SUM(`visits`) AS midle,
`users`.`surname`,
`users`.`photo`,
`users`.`id`,
`users`.`subject`,
`owner`,
`users`.`name`
FROM
`articl`
INNER JOIN `users` ON `users`.`phone` = `articl`.`owner`
GROUP BY
`users`.`name`
ORDER BY
midle
DESC