title: Select where timestampdiff is more than 1 day and there is some null
body: <p>I have a table with columns <code>id_user</code>, <code>to_sent</code> and <code>sent_datetime</code> that can be a valid <code>DATETIME</code> or <code>NULL</code>. It basically stores if something has been sent or not.</p>
  
  <p>I can only send 5 for each 24 hours so in that query I need to know which <code>id_user</code> has something <strong>to_sent=1</strong> and has not sent anything in the last 24 hours. That to_sent=1 will also, probably, have a <strong>sent_datetime=NULL</strong> but I don't know how to handle it.</p>
  
  <p>The sending will be later, with only distinct id_user will be OK.</p>
  
  <p>I've tried</p>
  
  <pre><code>SELECT id_user
  FROM send
  WHERE
      to_sent=1
      AND (TIMESTAMPDIFF(DAY, sent_datetime, NOW()) &lt; 1)
  GROUP BY id_user
  ORDER BY updated_datetime;
  </code></pre>
  
  <p>But I don't get only the ones that have more than 24 hours from last sending something.</p>