Hello, I am solving following task and it seems hard to me to find effective solution. Maybe somebody knows how to help me: We have table "purchases" and each one record is identified by "customer_id". We want to know not only how many different customers did at least one purchase per time period, grouped by time periods (easy task: "COUNT(DISTINCT customer_id)" with "GROUP BY period"), but also to know how many NEW customers there were. We define new customer as customer_id, which had first record in table "purchases" after 12 month of inactivity (no record in table "purchases" previous 12 months). I have found one solution, but it is very slow and ugly. I tried several other concepts, but without success. Any hint could be helpful for me. Thanks in advance! Jano