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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Selecting

Re: Selecting

From: Ms. D.H. Harvey <qq45_at_liverpool.ac.uk>
Date: 1 Sep 2000 08:20:06 GMT
Message-ID: <8onorm$t5m$1@news.liv.ac.uk>

,Bhavin Shah <bhavinsh_at_aludra.usc.edu> wrote:

If you're using sqlplus use: break on category prior to your query

: Thanks, but this still returns duplicate categories
: (ie) USA CA 
:      USA AZ
: I was looking for:
:      USA CA
:          AZ
 

: On Thu, 31 Aug 2000, Steve McDaniels wrote:  

:> select category, subcategory
:> from <table>
:> group by category, subcategory
:> /
:>
:> "Bhavin Shah" <bhavinsh_at_aludra.usc.edu> wrote in message
:> news:Pine.GSO.4.21.0008311037580.15367-100000_at_aludra.usc.edu...
:> > Hi,
:> >
:> > Say I have a table setup like the following:
:> >
:> > Category Subcategory
:> > ------------------------
:> > USA CA
:> > MEXICO
:> > USA AZ
:> > USA CA
:> >
:> >
:> > Is there a way to select the category only once and
:> > then get the list of subcategories with it?
:> > Right now I'm using select distinct category, subcategory
:> > from X, but am getting USA multiple times like
:> >
:> > -------------------
:> > USA CA
:> > USA AZ
:> > MEXICO
:> >
:> > What I would like is:
:> >
:> > --------------------
:> > USA CA
:> > AZ
:> > MEXICO
:> >
:> >
:> >
:> > TIA,
:> >
:> > Bhavin
:> >
:> >
:>
:>
:>

-- 
Helen
Received on Fri Sep 01 2000 - 03:20:06 CDT

Original text of this message

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