Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: Simple SUM Distinct Question

    Hello ALL,

    I am new to this forum and would like to ask of any person who can assist me in this problem.

    I currently have a table with 3 rows like this:

    Pid Counter P_cprice
    19 3 49.5
    16 5 143.5
    16 2 143.5

    I am trying to retrieve the following data:

    19 3 49.5
    16 7 143.5

    I have tried many ways but am going nuts over this. It looks simple but I have no clue. Is there anyone who can help me?

    Kevin.

  2. #2
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    89

    Re: Simple SUM Distinct Question

    Originally posted by Hatori


    Hello ALL,


    I am new to this forum and would like to ask of any person who can assist me in this problem.

    I currently have a table with 3 rows like this:

    Pid Counter P_cprice
    19 3 49.5
    16 5 143.5
    16 2 143.5

    I am trying to retrieve the following data:

    19 3 49.5
    16 7 143.5




    I have tried many ways but am going nuts over this. It looks simple but I have no clue. Is there anyone who can help me?

    Kevin.


    select pid,sum(counter),p_cprice
    from table_name
    group by pid,p_cprice
    Thanks and Regards,

    Praveen Pulikunnu

  3. #3
    Join Date
    Mar 2004
    Posts
    2
    hmm...now why didn't i think of that? thanks a whole lot!

Posting Permissions

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