title: SQL - Get the MAX COUNT access peak having only entrance and exit date
body: <p>I have a table that keeps the access to our system, and it have two columns called entranceTime and exitTime</p>
  <p>Eg:</p>
  <pre><code>entranceTime            exitTime
  2021-09-09 20:03:31+00  2021-09-09 20:05:39+00
  2021-09-09 20:03:58+00  2021-09-09 20:05:11+00
  2021-09-09 20:04:29+00  2021-09-09 20:05:36+00
  2021-09-09 20:04:09+00  2021-09-09 20:04:28+00
  2021-09-09 20:05:15+00  2021-09-09 20:05:30+00
  </code></pre>
  <p>What im trying to get is the &quot;peak&quot; of simultaneous connections, i tried using a subquery
  with MAX and COUNT like this:</p>
  <pre><code>SELECT Max((SELECT Count(&quot;a&quot;.&quot;id&quot;)
              FROM   &quot;public&quot;.&quot;access&quot; &quot;a&quot;
              WHERE  &quot;a&quot;.&quot;entrancetime&quot; &gt;= &quot;a2&quot;.&quot;entrancetime&quot;
                     AND a.&quot;entrancetime&quot; &lt;= &quot;a2&quot;.&quot;exittime&quot;))
  FROM   &quot;public&quot;.&quot;access&quot; a2
  </code></pre>
  <p>But with this query im getting the count of 5 instad of 3, is it possible to achieve this with only this two columns and using only SQL? Thank you for your time.</p>