title: Query for employee who has maximum leaves
body: <p>I have these tables with the following columns :</p>
  
  <ul>
  <li>Employee24 (EMPLOYEEID, FIRSTNAME, LASTNAME, GENDER, JOBROLES);</li>
  <li>Leave25 (EMPLOYEEID,LEAVEID, LEAVETYPE, STARTDATE, ENDDATE);</li>
  </ul>
  
  <p>I want to write a query to find the employee who has taken the maximum number of leave:</p>
  
  <pre><code>select emp.*, L.Startdate - L.Enddate 
  from leave25 l, employee24 emp
  where emp.employeeid = l.employeeid 
    and l.startdate - l.enddate = (select max(startdate - enddate) from  leave25)
  </code></pre>