The delay between orders is the time elapsed between two successive purchases by the same customer. Its distribution indicates a store's natural repurchase rhythm and helps choose the right moment for a follow-up or define the analysis window for a repurchase.
Example
SELECT customer_id, ordered_at - LAG(ordered_at) OVER (PARTITION BY customer_id ORDER BY ordered_at) AS delai FROM orders;