Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Simple query that consumes all temporary space.
Mark C. Stock wrote:
> "DA Morgan" <damorgan_at_x.washington.edu> wrote in message > news:1106765787.108318_at_yasure... >
> > > sorry, daniel > > you don't need a the count(*), or any other aggregate function in SELECT > list in order to have a group > > the group is simply defined by the GROUP BY, the HAVING clause is very, > very often used to filter the groups (in this statement the 2 LINE columns) > without exposing any grouping criteria > > here's a simpler example: > > "show me all the department and job combinations that have a per job > headcount = 1, but don't show me the headcount because i don't need it" > > SQL> select deptno, job > 2 from emp > 3 group by deptno, job > 4 having count(*)=1 > 5 / > > DEPTNO JOB > ---------- --------- > 10 CLERK > 10 MANAGER > 10 PRESIDENT > 20 MANAGER > 30 CLERK > 30 MANAGER > > it's really not that unusual, and is certainly very legal and very SQL-101 > > ++ mcs
Mea culpa. Don't know where my head was.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Wed Jan 26 2005 - 13:26:42 CST