title: MySQL matching partial strings with LIKE
body: <p>I'm trying create a MySQL query which will return a row (or more, but I'm only interested in a single row) an area suggestion when provided with a postcode.</p>
  
  <p>So, I have a table like so</p>
  
  <pre><code>area_id | postcode_start
  1       | NE
  2       | DL
  3       | DL1
  4       | DL2
  5       | DL6
  ...
  </code></pre>
  
  <p>And I wish to provide a postcode, for example DL5 8TB and for it to return the row <code>1 | DL</code> as the first characters match. </p>
  
  <p>Another example <code>DL6 4GH</code> would return two rows, <code>5 | DL6</code> and <code>2 | DL</code></p>
  
  <pre><code>SELECT *
      FROM (`area_postcodes`)
      WHERE CONCAT(LOWER(`area_postcodes`.`postcode_start`),'%')
          LIKE 'dl5 8tb';
  </code></pre>
  
  <p>Apparently it's a valid query but it always returns an empty set.</p>
  
  <p>You'll see I've added the wildcard <code>%</code> to the other side of the query but it doesn't seem to work and I don't know where else to even consider guessing how to go about it, it's almost like the reverse of a normal MySQL LIKE query.</p>