def get_modified_columns(fields, fields_to_replace):
    """

    This method updates the columns by adding prefix to each column if the column is being replaced and
    joins it with other columns.

    :param fields: list of fields of a particular table
    :param fields_to_replace: dictionary of fields of a table which needs to be updated
    :return: a string
    """
    col_exprs = []
    for field in fields:
        if field in fields_to_replace:
            col_expr = '{prefix}.concept_code as {name}'.format(
                prefix=fields_to_replace[field]['prefix'],
                name=fields_to_replace[field]['name'])
        else:
            col_expr = field
        col_exprs.append(col_expr)
    cols = ', '.join(col_exprs)
    return cols