1
I have a table called employees, with the following fields and values:
nome salário
a 10
b 100
c 30
d 40
I have a second table called function_more_caro, with the same fields as the previous one, but with no record.
nome salário
* *
I need the table function_more_caro be always up-to-date with the data, from the table employees, of the individual who has the highest salary.
For example, with the data above the table function_more_caro would be as follows:
nome salário
b 100
I don’t want the table function_more_caro be always filled with new values, but yes up-to-date, that is, there will always be only 1 registration, which is of the most expensive employee.
I don’t know how to do this (I’m a beginner in this subject). Someone could help me?
Thank you for answering. Script runs error free, but makes no changes.
– Danilo
have corrected the test there
– Vintorisk
Again the script runs without errors, but the table works.
– Danilo
Voce need to insert a record in the table function_more_caro, done this using the script I put, I created the two tables here, inserted some values ,and worked perfectly
– Vintorisk
@Vintorisk, could you edit your answer and make a brief description ? For doing so, not only will help the AP to understand the code, as well as users with the same problem in future, and not only
CTRL+C
andCTRL+V
I could tell ?– NoobSaibot
Thank you @Vintorisk. It worked correctly.
– Danilo