title: Joining 2 select queries on 2 different tables in PostgreSQL
body: <p>I have two separate queries on 2 different tables which I am trying to join into one query. Both tables are within the same schema.</p>
  
  <p>I am trying to form a query which will return the forumid, threadid and subject of the most recent post in a forum. I can use the two queries I wrote below, but for the sake of efficiency I would prefer to use just one if possible.</p>
  
  <p>The following are my queries:</p>
  
  <pre><code>1&gt;
  SELECT forumid,threadid
  FROM threadtable
  WHERE modifieddate = (select max(modifieddate) from threadtable);
  
  2&gt;
  SELECT subject
  FROM messsagetable
  WHERE modifieddate = (select max(modifieddate) from messsagetable);
  </code></pre>
  
  <p>I have tried a few solutions but seem to be going round in circles. Any suggestions appreciated. Version is Postgres 8.1.</p>