title: How to calculate DATE Difference in PostgreSQL?
body: <p>Here I need to calculate the difference of the two dates in the <code>PostgreSQL</code>.   </p>
  
  <p><strong>In SQL Server</strong>: Like we do in <code>SQL Server</code> its much easier.</p>
  
  <pre><code>DATEDIFF(Day, MIN(joindate), MAX(joindate)) AS DateDifference;
  </code></pre>
  
  <p><strong>My Try</strong>: I am trying using the following script:</p>
  
  <pre><code>(Max(joindate) - Min(joindate)) as DateDifference;
  </code></pre>
  
  <p><strong>Question</strong>:   </p>
  
  <ul>
  <li><p>Is my method correct?</p></li>
  <li><p>Is there any function in <code>PostgreSQL</code> to calculate this?</p></li>
  </ul>