title: How do I find the most recent value from two tables?
body: <p>I have two tables: organization and journey_alias</p>
  <p>the organization table has the following columns:
  organization_id, slug</p>
  <p>the journey_alias table has the following columns:
  organization_id, url, created_at, user_id</p>
  <p>I'd like to return the following</p>
  <p>user_id, slug, created_at, url (only returning the most recently created url for each user).</p>
  <p>Here's what i've tried:</p>
  <pre><code>SELECT journey_alias.url, journey_alias.user_id, organization.slug, 
  MAX(journey_alias.created_at) AS &quot;mostrecent&quot;
  FROM journey_alias
  INNER JOIN organization ON journey_alias.organization_id=organization.organization_id
  GROUP BY journey_alias.user_id
  </code></pre>
  <p>I see answers that solves for 1 table, but I can't find how to do this when there are 2 tables.  Any help is much appreciated, thanks!</p>