title: MySQL - How do I add a "flag" column to a select query if date is expired (ie. less than today's date)?
body: <p>I have two tables. One with peoples names (drivers) and one with their driving license (licenses) details and expires. I need to merge the two tables and list the driver's name, id number and whether the license is expired or not. </p>
  
  <p>I have the following which returns all the drivers with their license and expiry but I would like to add a final column which states (expired/valid) based on the expiry date returned (timestamp).</p>
  
  <pre><code>SELECT d.name AS 'Driver Name', d.nric AS 'NRIC', l.expiry AS 'Expiry' FROM drivers d, licenses l WHERE d.driverID=licenses.driverID ORDER BY name ASC
  </code></pre>
  
  <p>I need a fourth column to be added which evaluates whether <code>l.expiry</code> is "less than" today, ie expired.</p>
  
  <p>The output should be like this:</p>
  
  <pre><code>Driver Name NRIC Expiry Validity
  Joe Blooggs 1234 1/1/14 Valid
  Joe Blooggy 1235 1/3/14 Invalid
  </code></pre>
  
  <p>Is there a way to do this?</p>