title: Oracle query showing error "not a GROUP BY expression"
body: <p>Hello I have made a query to get employee first in and last out time for a date range for this I used max and min function to get first in and last out time here is my query </p>
  
  <pre><code>     select 
       fullname,
       "IN",
       out
       from
       (
              select
              fullname,direction,
              employment.employeeid,NATIONALID,departmentname,designation.designationname,
              min(case when direction = 'IN' then to_date(to_char(((TO_DATE('19700101','yyyymmdd') + (tstamp/24/60/60) + 6/24)), 'dd-mm-yyyy hh12:mi:ss PM'), 'dd-mm-yyyy hh:mi:ss pm') end) "IN",
              max(case when direction = 'OUT' then to_date(to_char(((TO_DATE('19700101','yyyymmdd') + (tstamp/24/60/60) + 6/24)), 'dd-mm-yyyy hh12:mi:ss PM'), 'dd-mm-yyyy hh:mi:ss pm') end) out
              from eofficeuat.entrylog_cpa
              join eofficeuat.employee on entrylog_cpa.hrrecordid=employee.hrrecordid
              join eofficeuat.employment on employee.hrrecordid=employment.hrrecordid
              join eofficeuat.designation on employment.designationid=designation.designationid
              join eofficeuat.department on employment.departmentid=department.departmentid
              where department.departmentname = 'SECURITY'
              and tstamp &gt;= 1567274400 and tstamp &lt; 1569862800 
              and eofficeuat.employment.employeeid='022013'
              group by eofficeuat.employment.employeeid
              order by tstamp asc
  
        )
  </code></pre>
  
  <p>but I am getting this error</p>
  
  <pre><code>      ORA-00979: not a GROUP BY expression
  </code></pre>
  
  <p>please tell me how can i fix this.</p>