title: Filtering column with aggregated function with itself to show max records
body: <p>I am having a hard time trying to figure out the best way to filter records against itself using the MAX function.</p>
  
  <p>My desired results are to have my IDs in one column and then the max records from the group by on the next column.</p>
  
  <pre><code>ID       Max_id  group_id
  3000  3004     6
  3001  3004      6  
  3002  3004      6
  3003  3004      6
  4000  4004      20
  4001   4004      20
  4000   4001      42
  </code></pre>
  
  <p>Here is my table structure and sampling data. I can use a min and max function and group by group_id but cannot access the middle ID's when doing this. When I attempt to use just the ID without the min() I get constraint errors.</p>
  
  <p><a href="http://sqlfiddle.com/#!9/40ef34/1" rel="nofollow">http://sqlfiddle.com/#!9/40ef34/1</a></p>