2
I am starting work with database and would like to perform an intelligent action in the bank.
I have two tables that store information from different sensors, each with its respective columns.
I would like to take a column of each table (of my choice) and carry out a sum of both, as the select below:
SELECT (SELECT COLUNA1_T1 FROM T1) + (SELECT COLUNA1_T2 FROM T2) as COLUNA1_T3
My COLUNA1_T3 result would be the sum of the first of a row of columns, for example.
This action could be run through a Trigger after inserting some data in tables T1 and T2 and thus adding the added row data.
I would like some hint as to how this can be accomplished.
Thank you.
Do you want to run this directly in a database query or are you going to use something for it? (some site, program...)
– Leticia Rosa
I’ll use it right at the bank, so it controls the entrances.
– Felipe Figueiró