title: SELECT 1 percent of distinct values
body: <p>SQL Server 2008 R2</p>
  <p>I have a table called Actions, this would be a snippet of what it looks like</p>
  <pre><code>ActionID | ActionType | ActionUserID | ActionDateTime
  ---------+------------+--------------+---------------------
  555363     Open         9843           2020-09-15 09:27:55
  555364     Process      2563           2020-09-15 09:31:22
  555365     Close        8522           2020-09-15 09:37:48
  555366     Detour       9843           2020-09-15 09:42:42
  555367     Process      9843           2020-09-15 09:51:50
  555368     Close        8522           2020-09-15 09:55:45
  555369     Open         1685           2020-09-15 09:57:12
  555370     Detour       2563           2020-09-15 10:03:23
  555371     Detour       9843           2020-09-15 10:04:33
  555372     Close        8522           2020-09-15 10:07:44
  </code></pre>
  <p>The table has hundreds of thousands of rows.  What I want to do is review 1% of all actions performed by each user for a specific month.</p>
  <p>I know I can get 1% of everything by doing:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT TOP 1 PERCENT * 
  FROM Actions 
  WHERE ActionDateTime BETWEEN '09/01/2020' AND '09/30/2020' 
  ORDER BY NEWID()
  </code></pre>
  <p>I know I can get 1% of a specific user by doing:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT TOP 1 PERCENT * 
  FROM Actions 
  WHERE ActionUserID = 9843 
    AND ActionDateTime BETWEEN '09/01/2020' AND '09/30/2020' 
  ORDER BY NEWID()
  </code></pre>
  <p>But what I really want to get is 1% of each user.  I know I could get a list of the users who performed actions during the month by doing:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT DISTINCT(ActionUserID) 
  WHERE ActionDateTime BETWEEN '09/01/2020' AND '09/30/2020'
  </code></pre>
  <p>However I am not sure how to combine these two queries.</p>