Difference between two rows in MySQL Workbench, but LAG is not authorized
SELECT id
    ,product_id 
    ,date
    ,weight
FROM
(
SELECT t.id
    ,t.product_id 
    ,t.date
    ,t.weight
    ,(SELECT weight FROM table WHERE product_id = t.product_id  AND date &lt; t.date ORDER BY date LIMIT 1) AS prev_weight
    ,(SELECT weight FROM table WHERE product_id = t.product_id  AND date &gt; t.date ORDER BY date LIMIT 1) AS next_weight
FROM table AS t 
) AS t1
WHERE weight &lt;&gt; prev_weight OR weight &lt;&gt; next_weight