I have a table table1
like:
ID | Content
-------------
1 | run2
2 | run3
3 | run1
2 | run2
2 | run2
2 | run1
2 | run2
2 | run1
And another table table2
:
Content | ID
----------------
runX | 1
runX | 2
runX | 2
runX | 3
I want to run a query to automatically update table2 Content
using most common Content
in table1 for each ID
. That's it after the query, table 2 would be:
Content | ID
----------------
run2 | 1
run2 | 2
run1 | 3
I tried joining table1 to table2 on ID
match but if I set Content
to max(Content)
it says invalid. How can I go about this?