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 -> SQL statement question. Please Help ...

SQL statement question. Please Help ...

From: Jimmy <c6635500_at_comp.polyu.edu.hk>
Date: Wed, 28 Jul 1999 00:26:10 -0700
Message-ID: <379EB092.2892A8D4@comp.polyu.edu.hk>


Hello all,

    I have a table with the following definition: (assume no P.K.)

    A        number
    B        varchar2(10)

    And this table has the following rows:

    A B

    Can I obtain the result by a single SQL statement as follows:
    A            B                 C
    -----        --------    ----------
    1            AAA            1
    1            AAA            2
    1            AAA            3
    2            BBB             1
    2            BBB             2
    3            CCC            1

    i.e. if A and B have the same values, C should be set to number of count of the pair of A and B.

Thanks,
Jimmy Received on Wed Jul 28 1999 - 02:26:10 CDT

Original text of this message

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