title: GROUP BY in MySQL query
body: <p>Suppose, I have a table like this:</p>
  
  <pre><code>+---------+------------------+
  | post_id | original_post_id |
  +---------+------------------+
  | 1       | 0                |
  | 2       | 0                |
  | 3       | 0                |
  | 4       | 2                |
  | 5       | 2                |
  | 6       | 0                |
  | 7       | 1                |
  | 8       | 1                |
  | 9       | 1                |
  | 10      | 0                |
  | 11      | 0                |
  | 12      | 3                |
  +---------+------------------+
  </code></pre>
  
  <p>In a nutshell, in this table I contain users posts, and I'd like to show something like a timeline. All the records, which have <code>original_post_id=0</code> - are the original posts, and must be shown in any case. But all the records with <code>original_post_id!=0</code> - are the reposted, so I'd like to show them just one time. So, as a result, I need something like this:</p>
  
  <pre><code>+---------+------------------+
  | post_id | original_post_id |
  +---------+------------------+
  | 1       | 0                |
  | 2       | 0                |
  | 3       | 0                |
  | 4       | 2                |
  | 6       | 0                |
  | 7       | 1                |
  | 10      | 0                |
  | 11      | 0                |
  | 12      | 3                |
  +---------+------------------+
  </code></pre>
  
  <p>As I understand, I have to use <code>GROUP BY</code>, but how exactly?</p>