Exclude a column of select statement in group by clause
<p>I have the following query which generates a report</p>

<pre><code>select 
  cust.firstname as "FIRST NAME",
  cust.lastname as "LAST NAME",
  dept.name as "DEPARTMENT",
  subdept.name as "SUB DEPARTMENT",
  count(*) "cust type"
from cust
join dept on dept.deptid = cust.deptid
join subdept on subdept.deptid = cust.subdeptid
join custactivity on custactivity.custid = cust.custid
where custactivity.swipetime &gt; (trunc(sysdate - 1))
group by cust.firstname,cust.lastname,dept.name,subdept.name
having count(*) &gt; 5
order by "DEPARTMENT" ;
</code></pre>

<p>Now, I want to include the column "custactivity.swipetime" only in the select statement but not group by clause as it is a time field and I get incorrect results if I include that in group by clause. How's is it possible?</p>

<p>I tried the solution in <a href="https://stackoverflow.com/questions/11995437/oracle-select-and-group-by-excluding-one-field">ORACLE Select and group by excluding one field</a>
but it didn't work out. </p>

<p>Can anyone help?</p>