Mysql
 sql >> Datenbank >  >> RDS >> Mysql

Gruppieren Sie nur die angrenzenden Zeilen

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