title: mysql cast as interval
body: <p>is it possible to cast as an interval in MySQL?</p>
  
  <p>I want to evaluate a value from the query as an interval, like this:</p>
  
  <pre><code>select DATE_SUB(NOW(),CAST(user.expiry_interval AS interval))
  </code></pre>
  
  <p>where user.expiry_interval is 'INTERVAL 1 WEEK' or something like that</p>
  
  <pre><code>select DATE_SUB(NOW(),CAST('INTERVAL 1 week' AS INTERVAL))
  </code></pre>