I have a table with a column that store a number. I also have 2 different array: the first one store the value to check, the second one store the new value to save in the column.
I need a query that check if the value in the column is equal to any value of the first array and if it is true update the column value with the same position value of the second array.
For example:
column value = 2
firstArray = [1, 2, 3]
secondArray = [5, 6, 7]
I want to check if 2 is in firstArray: yes... it is equal to firstArray[1] then I want to update the column value with secondArray[1] at the end of the query column value will be 6.
It is possibile?
I found this MySQL: Update a columns if certain value but I'm really new in querying MySQL and I don't know how to make it work in my case.
Thanks for the help
Daniele