title: How to use SQL to sample 50% of records in each group?
body: <p>I am new to SQL. My data is like this:</p>
  
  <pre><code>c1  c2  c3  group
  1   2   1   1
  1   2   2   1
  3   5   6   1
  2   4   7   2
  5   3   4   2
  2   1   3   2
  6   4   4   2
  7   8   3   3
  1   2   2   3
  3   2   2   3
  </code></pre>
  
  <p>For each group (indicated by the column group), I want to sample 50% of the records (keeping all the columns) and save the result into a new table. </p>