DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Query help

  1. #1
    Join Date
    Jun 2008
    Posts
    4

    Query help

    Hi,
    Can any one give me query to insert data
    I have a table A with
    col1 col2
    A 3.2
    B 2.3
    C 12.8
    D 34.27
    A 5.4
    B 12.2
    C 7
    D 24

    I want to insert into a temporary table B
    the distinct values of Table A col1 and sum(col2)
    Table B
    col1 col2
    A 8.6
    B 14.5
    C 19.8
    D 58.27


    Thanks

  2. #2
    Join Date
    Apr 2006
    Posts
    377
    Hint, check out SUM and GROUP BY.

Posting Permissions

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


Click Here to Expand Forum to Full Width