Grouping by date range in a column
In SQL-Server 2012 version, looks straightforward with the LAG() function:

SELECT
    Action,
    Number = COUNT(*) 
FROM
    ( SELECT 
          Action, 
          Diff = DATEDIFF(day, LAG(Date) OVER (PARTITION BY Action ORDER BY Date), Date)  
      FROM
          a
    ) AS t
WHERE 
    Diff &gt; 3 OR Diff IS NULL
GROUP BY 
    Action ;


This should work, even in 2008 version:

SELECT
    Action,
    Number = COUNT(*) 
FROM
    a
WHERE 
    NOT EXISTS 
    ( SELECT *
      FROM a AS b
      WHERE b.Action = a.Action
        AND ( (b.Date &gt;= DATEADD(day, -3, a.Date) AND b.Date &lt; a.Date)
           OR (b.Date = a.Date AND b.ID &lt; a.ID)
            )
    ) 
GROUP BY 
    Action ;