0
I have the following problem: I have a table rev_tasks which contains id as key, and a second table rev_reviews and has as a foreign key task_id, pointing to the task, in addition I have a field (revised) whether the review has been reviewed or not.
In the rev_task I have a field (totalNRev) indicating how many views NAY were revised
at this time I’m having problems, I have to update the database for all tasks updating the totalNRev field.
Could you give me suggestions ? Thanks in advance.
update knife using Join
– Victor
Hello Victor, could you be more clear? the Join would be on set or on Where ?
– user3111254
do not understand... that you want to update the field totalNRev in the table rev_task right ? Or fields from two different tables at the same time, in this case could use Join
– Victor
that’s right, this field is the count of all the rev_reviews where the revised = 'Nao', in addition to this condition I have to update only the rev_tasks that the id is equal to the task_id of the rev_reviews table, I could see there ?
– user3111254
I will post an answer to Voce check if it meets your need, if yes comment below the answer
– Victor
Hello Victor, I managed to solve the problem, I put as a response my resolution, thank you//
– user3111254
ok I will remove my answer then
– Victor