Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    4

    Unanswered: problem counting multiple occurrances of a pair of entries

    Hi Everyone,

    I was having problems writing up a query to do the following:

    I have a table with columns A B and C

    I needed to count all occurrances of unique (A,B) tuples in the table

    For Eg:

    A B C
    foo foo ZOO
    foo foo BCV
    xoo cdv rdf
    foo foo ert
    xoo cdv see
    red gre

    i needed an output

    foo foo 3
    xoo cdv 1

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    SELECT A,B,COUNT(*)
    FROM myTable99
    GROUP BY A,B
    HAVING COUNT(*) > 1
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •