title: Sort records with field that don't exist
body: <p>I have a table with 4 columns: </p>
  
  <pre><code>| id | article_id | meta_key | meta_value |
  |----|------------|----------|------------|
  | 1  | 135        | author   | Beth       |
  | 2  | 135        | status   | draft      |
  | 3  | 135        | paywall  | yes        |
  | 4  | 136        | author   | Kim        |
  | 5  | 136        | status   | publish    |
  | 6  | 137        | author   | Mary       |
  | 7  | 137        | status   | publish    |
  </code></pre>
  
  <p>I have to implement a feature which adds the <code>meta_key</code> "paywall" with either a <strong>yes</strong> or a <strong>no</strong> <code>meta_value</code> to new articles, which means the meta_key "paywall" does not exist for the older records.</p>
  
  <p>I need to fetch the records by meta_key="paywall" and sort by meta_value.
  The problem is for the articles without the meta_key "paywall", when the sorting is DESC, the articles are ordered by [ Yes ], [ No ], [ articles without paywall meta key ].</p>
  
  <p>Is there a way in SQL where I can sort by assuming the value of meta_value to be <strong>yes</strong> for a key that does not exist so that the DESC is returned as [ Yes ], [ articles without paywall meta key ], [ No ]?</p>
  
  <p>The query I have:</p>
  
  <pre><code>SELECT article_id, meta_key, meta_value
  FROM wp_meta
  WHERE meta_key="paywall"
  ORDER BY meta_value
  DESC
  </code></pre>