Jump to content

creating tables with columns and values from values in other tables


orise

Recommended Posts

Hi all,

            Does anyone know how to calculation values in a column of a table and store the output in another column of a different table i.e. I have item and value columns where an item and its value say 'Dealing securities' and '$3,000' respectively I want to be able to add the value of these and other items together saying in table balancesheet and store the value under the values with an item column in table averages say item 'fixedasset' with its value got from addition of two values in another table balancesheet.

 

INSERT INTO destinationTableName (columnName1, columnName2, ...)
SELECT dataForCol1, dataForCol2, ...
FROM sourceTableName
WHERE conditions

 

If you can build the SELECT statement to return the columns and rows you want to INSERT into the other table, it is pretty much just a matter of combining the two statements. I'm sure there are some limitations (see the manual)

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.