fix sql syntax in node_reg_for_pid