title: Find latest value in a comparison of data between 2 tables
body: <p>I Have 2 tables in my DB and I want to compare values of 2 select queries Ive made on each one</p>
  
  <p>Table 1: click_log</p>
  
  <p>Query table 1:</p>
  
  <pre><code>SELECT *
  FROM click_log
  </code></pre>
  
  <p>Table 2: km_articles</p>
  
  <p>Query table 2:</p>
  
  <pre><code>SELECT km_article_no
  FROM km_articles
  WHERE  km_article_date &lt;= "2017-10-31" AND km_article_status = "Published" AND km_article_view_count &lt;= "5"
  </code></pre>
  
  <p>The columns I want to compare are table link_clicked for table 1 with km_article_no and I know I will find repeated matched, nevertheless from those repeated matches I want to find the latest one that I want to get from another column in table 1 called "when_clicked" that contains data information, not sure How can i put together those to queries and then narrow them down.</p>
  
  <p>this is how the tables look like:</p>
  
  <p>Table 1:</p>
  
  <pre>
  |link_clicked|when_clicked
       KB00001 | 2017-08-02
       KB00001 | 2017-12-02
       KB00002 | 2017-08-02
       KB00002 | 2017-09-02
       KB00003 | 2017-09-02
       KB00003 | 2017-09-02
  </pre>
  
  <p>Table 2:</p>
  
  <pre>
  km_article_no|km_article_ti|km_article_status|km_article_view_count|km_article_date
    KB00001    |outlook IOS  |  Published      |         5           | 2017-01-02
    KB00002    |outlook CSS  |  Published      |         4           | 2017-01-05
    KB00003    |outlook ZTE  |   Retired       |         3           | 2017-01-09
  </pre>