-2
I’m filling a table with data that I pick up in a JSON, as shown in the image:
When the markettype is 'place', does not have the correct information of 'Category' and 'Distance'. When the markettype is 'win', have the correct information. I wanted to fill out this two information with the correct data, and tried to do some update
comparing 'marketdate' and 'idrunn', to make sure it’s the same event, and marketype = 'win'
, take the two values I need and update on the line 'place', but it didn’t work... The situation is too complex for my little knowledge.
In short, it would be to catch the marketdate and the idrunn of the line marketype = 'win'
and compare with lines markettype = 'place'
. When the marketdate and the idrunn for equals, means it’s the same event there would be update the field 'Category' and 'Distance' of the line 'place'.
Could someone help me?
and what have you tried to do? put the query to the question. But you will need to do a subquery to get the other value
– Ricardo Pontual
See if it helps (update with self-join) https://stackoverflow.com/questions/2380353/update-with-self-join
– Motta