orise Posted March 21, 2012 Share Posted March 21, 2012 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. Quote Link to comment Share on other sites More sharing options...
DavidAM Posted March 21, 2012 Share Posted March 21, 2012 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) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.