Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Agrupe apenas as linhas adjacentes

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