def get_view_sql(self, repo_base, repo, table, view_params, license_id):
        # create view based on license
        license = LicenseManager.find_license_by_id(license_id)

        pii_def = license.pii_def

        if license.pii_removed:
            # remove columns
            query = ('SELECT column_name FROM information_schema.columns '
                     'WHERE table_schema = %s'
                     'AND table_name = %s'
                     )
            params = (repo, table)
            res = self.execute_sql(query, params)

            columns = [t[0] for t in res['tuples']]

            all_columns = set(columns)
            removed_columns = set(view_params['removed-columns'])
            columns_to_show = list(all_columns - removed_columns)
            # if columns_to_show < 1:
            #     #error
            #     pass

            query = 'SELECT {} FROM {}.{}'

            columns_query = ""
            for i in range(len(columns_to_show)):
                columns_query += columns_to_show[i]
                if i < len(columns_to_show) - 1:
                    columns_query += ","

            query = query.format(columns_query, repo, table)

            return query