function getRep(ar) {
res = [];
ar.forEach(el => {
el.forEach(a => {
res[a] = res[a] ? res[a]+1 : 1;
});
});
out = [];
res.forEach((el, i) => {if (el == ar.length) out.push(i);});
return out;
}
getRep([[1,2,3,4], [1,3,6,9], [1,3,9,10]]); // [1, 3]
UPDATE products p
JOIN update_info ui ON t.id = ui.id
SET p.price = ui.price