I have this statement which returns expected results for a single email:
SELECT email, ordered_date,
LAG(ordered_date,1) OVER (ORDER BY ordered_date) prev_order_date
WHERE EMAIL = 'TEDNUGENT@SNET.NET'
GROUP BY email, ordered_date
order by email, ordered_date
But when I remove the WHERE clause and run for all, the lag does not group as expected.