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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Distinct string statement

Re: Distinct string statement

From: Paul Izzo <paul.izzo_at_mosca-ag.com>
Date: 22 Feb 2005 06:43:33 -0800
Message-ID: <1109083413.035317.319530@f14g2000cwb.googlegroups.com>


DA Morgen,

  Do you every have anything to say other than "this looks like homework"? You've said the same thing so many times in so many threads.

  Marina I feel for you. You have a genuine problem and some bozo's say it's homework but give no help in return.

  Being once a victim to this I'll help you out.

  In order to do your create your UNION statement you need to know what your up against. Do a couple queries in order to:

select
count(id)
from table_name
group by id

select
id,count(symbol)
from table_name
where id = 'id'
group by symbol

  The output from these 2 queries you can put into a cursor. I guess that you might be able to do this all in 1 cursor but that beyond me (perhaps someone might be able to help out on this) (But not D A Morgen)

  Or you can put all of the triplet possiblilties that you recieved from your queries and put them into a SELECT statement using UNION like Malcolm states using DISTINCT. The final query should look something like this:

select distinct symbol
from table_name
where symbol = "abc"
union
and symbol = "def"
... Received on Tue Feb 22 2005 - 08:43:33 CST

Original text of this message

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