Results 1 to 2 of 2

Thread: Query

  1. #1
    calvin Guest

    Query

    What's the best way to make(A) look like (B)

    ipia_id iyear cnt
    ------- ----------- -----------
    1 1999 1
    1 1999 1
    1 1999 2
    1 1999 8
    1 2000 1
    1 2000 2
    1 2000 2


    ipia_id iyear cnt
    ------- ----------- -----------
    1 4 12
    1 3 5

  2. #2
    WizKid Guest

    Query (reply)


    select ipia_id , count(*), sum(cnt)
    from test group by ipia_id , iyear


    ------------
    calvin at 6/28/01 4:14:08 PM

    What's the best way to make(A) look like (B)

    ipia_id iyear cnt
    ------- ----------- -----------
    1 1999 1
    1 1999 1
    1 1999 2
    1 1999 8
    1 2000 1
    1 2000 2
    1 2000 2


    ipia_id iyear cnt
    ------- ----------- -----------
    1 4 12
    1 3 5

Posting Permissions

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