SELECT user_id
FROM notifies n
WHERE NOT
(
SELECT user_id
FROM notifies ni
WHERE ni.id < n.id
ORDER BY
id DESC
LIMIT 1
) <=> user_id
SELECT user_id
FROM notifies n
WHERE NOT
(
SELECT user_id
FROM notifies ni
WHERE ni.id < n.id
ORDER BY
id DESC
LIMIT 1
) <=> user_id