write your query so that all non-aggregate columns in the SELECT list are in the GROUP BY
with the GROUP BY that you have, the columns e.empno, e.fname, and e.lname should be involved in aggregate functions, e.g.
Code:
select count(distinct e.empno)
, max(e.fname)
, min(e.lname)
, w.location, w.buildingno, w.floorno, w.facilityno
from employee e
left outer
join workarea w
on e.empno = w.empno
group
by w.location, w.buildingno, w.floorno, w.facilityno
this query at least makes syntactic sense, although semantically it's pretty useless
rudy
http://r937.com/