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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: query

RE: query

From: Lex de Haan <lex.de.haan_at_naturaljoin.nl>
Date: Tue, 29 Mar 2005 14:11:43 +0100
Message-Id: <20050329131143.C97B28011710@smtp-out1.tiscali.nl>


Hi Seema,
what you want is very, very, *VERY* un-relational in the first place... I guess one of the tricks you can use is write the query as a UNION ALL construct
with four independent queries, select an additional constant (i.e. 1,2,3,4), and sort on that column (optionally suppressing it from the output)

hope this helps,
kind regards,

Lex.  



Visit my website at http://www.naturaljoin.nl

-----Original Message-----

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Seema Singh
Sent: Tuesday, March 29, 2005 14:04
To: oracle-l_at_freelists.org
Subject: query

hi
I'm getting the output from following
select known_category_id, count(rowid) from ovt_recognized_categories where known_category_id in (3,1,8,7) group by known_category_id ;

KNOWN_CATEGORY_ID COUNT(ROWID)
----------------- ------------

               1            1
               3            1
               7            1
               8            1

I want the out would be like
KNOWN_CATEGORY_ID COUNT(ROWID)
----------------- ------------
               3            1
               1            1
               8            1
               7            1

Following are sample data.

ROWNUM ROWID KNOWN_CATEGORY_ID
---------- ------------------ -----------------

        1 AAANmrAAcAAAY0wAAA               986
        2 AAANmrAAcAAAY0wAAB                 1
        3 AAANmrAAcAAAY0wAAC                 2
        4 AAANmrAAcAAAY0wAAD                 3
        5 AAANmrAAcAAAY0wAAE                 4
        6 AAANmrAAcAAAY0wAAF                 5
        7 AAANmrAAcAAAY0wAAG                 6
        8 AAANmrAAcAAAY0wAAH                 7
        9 AAANmrAAcAAAY0wAAI                 8
       10 AAANmrAAcAAAY0wAAJ                 9
Please sugget what would be query.
thanks
-Seema

--

http://www.freelists.org/webpage/oracle-l

--

http://www.freelists.org/webpage/oracle-l Received on Tue Mar 29 2005 - 08:15:31 CST

Original text of this message

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