Assuming you have a table named logins that contains user_id and login_date , you can execute the following query: SELECT user_id , MIN ( login_date ) , MAX ( login_date ) FROM ( SELECT user_id , login_date , DATEDIFF ( day , ROW_NUMBER ( ) OVER ( PARTITION BY user_id ORDER BY login_date ) , login_date ) as grp FROM logins ) as SubQueryAlias GROUP BY user_id , grp HAVING COUNT ( * ) >= 3 This query first assigns a number to each user's login dates. The DATEDIFF function in the subquery is crucial, as it calculates the difference between the login date and the row number. If this difference remains constant for a set of dates, it indicates that those dates are consecutive. Using this grp , you can group all consecutive dates together and select only those series that have a count of three or more.