Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How do you select distinct rows that are similar but not identical

Re: How do you select distinct rows that are similar but not identical

From: mcstock <_at_>
Date: Wed, 3 Dec 2003 10:23:15 -0500
Message-ID: <ueednR9C5sfbnFOiRVn-vA@comcast.com>


if you want the substation/terminal name to show up just once at the lowest level (ie, highest level number), then maybe you can do something like this:

select max(the_level), job, deptno
from
(

   select level as the_level, ename, job, deptno    from emp
   connect by prior empno = mgr
   start with mgr is null
)
group by job, deptno
order by max(the_level) desc

-- 
Mark C. Stock
mcstock -> enquery(dot)com
www.enquery.com training & consulting


"colinlyse" <colinlyse_at_yahoo.com> wrote in message
news:3fcdf1d3$0$214$45beb828_at_newscene.com...

| have a resultset as follows (its result of of a connect by, prior tree
query
| that shows me the hier. of substations) it is ordered by the Level desc.
|
| LEVEL TERMINAL_ID_SQ SUBSTATION TERMINAL_NAME
| 10 11664 TAS50
69KV1
| 8 11664 TAS50
69KV1
| 6 7782 TSR41 1
| 4 7782 TSR41 1
| 2 7500 DC315
4kV-1
|
|
| I want the following result set
|
| SUBSTATION TERMINAL_NAME
| TAS50 69KV1
| TSR41 1
| DC315 4kV-1
|
| note that is has to be in the order of the level but i don't want to see
same
| instance of substation eventhought it is at a different level (don't care
it
| it uses level 10 or 8 they are identical in station and terminal names)
Received on Wed Dec 03 2003 - 09:23:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US