I have the following table structure

  • user visit (userId -fk-, userCountryVisit)
  • user (userId -pk-, countryId -fk-, other data)
  • country (countryName)

There are a lot of data in user visit table with userCountryVisit = null

I need to update all records that have null value in userCountryVisit to be equal the value of countryName using the userId FK and countryId FK

which means I need to make update statement with two inner joins and one select

Is that possible I did not do it before, can anyone advice how to make it?

Here is screenshots from the data

enter image description here

enter image description here

enter image description here

0 Answers