SELECT
*
FROM
(
SELECT
act.*,
users.name,
users.lname,
users.ava_file
FROM
act
INNER JOIN users WHERE act.date > "1517427936" AND act.date < "1517428356" AND act.creator = users.id
ORDER BY
act.date
DESC
) a
GROUP BY
a.creator
SELECT
b.*,
users.name,
users.lname,
users.ava_file
FROM
(
SELECT
a.*
FROM
(
SELECT
act.*
FROM
act
WHERE
act.date > "1517427936" AND act.date < "1517428356"
ORDER BY
act.id
DESC
) a
GROUP BY
a.creator
) b
INNER JOIN users WHERE b.creator = users.id
CREATE TEMPORARY TABLE `act_tmp`
SELECT
`act`.*
FROM
`act`
LEFT JOIN(
SELECT
`creator`,
MAX(`date`) AS `date`
FROM
`act`
WHERE
`act`.`date` > "1517427936" AND `act`.`date` < "1517428356"
GROUP BY
`creator`
) AS `act_b`
ON
`act`.`creator` = `act_b`.`creator` AND `act`.`date` = `act_b`.`date`
WHERE
`act_b`.`creator` IS NOT NULL
GROUP BY
`act`.`creator`;
SELECT
`act_tmp`.*,
`users`.`name`,
`users`.`lname`,
`users`.`ava_file`
FROM
`users`
LEFT JOIN `act_tmp` ON `users`.`id` = `act_tmp`.`creator`
WHERE
`act_tmp`.`creator` IS NOT NULL
GROUP BY
`users`.`id`
select
user_id,
act_date
from table
group by user_id
select
user_id,
min(act_date) -- или max|sum|avg и т.п.
from table
group by user_id