I'm starting the database work and would like to do some smart action on the database.
I have two tables that hold different sensor information, each with its own columns.
I would like to get a column of each table (of my choice) and perform a sum of both, as the select below:
SELECT (SELECT COLUNA1_T1 FROM T1) + (SELECT COLUNA1_T2 FROM T2) as COLUNA1_T3
My result in COLUMN1_T3 would be the sum of the first of a row of columns, for example.
This action could be run through a trigger after insertion of some data in the T1 and T2 tables and thus add the data of the added line.
I would like some suggestion of how this can be accomplished.
Thank you.