the problem is because table_1 is too far from inner query, use: UPDATE table_1 SET table_1.column_3 = (SELECT count(DISTINCT column_5) ...
www.google.com.tw