Sql queries

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bert Geys

    #1

    Sql queries

    Hi

    I want to do a query where I make totals of colums , and insert these
    totals into another table.

    for example :

    SELECT sum(val1) AS tot_1, sum( val2 ) AS tot_2
    FROM tableA ;


    and the values tot_1 and tot_2 I want to insert into another table

    INSERT INTO tableB SET tot_2003 = tot_1, tot_2004 = tot_2;


    How can I do this???

    Bert
Working...