# ALTER VIEW

## Syntax

```sql
ALTER
    [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
    [DEFINER = { user | CURRENT_USER }]
    [SQL SECURITY { DEFINER | INVOKER }]
    VIEW view_name [(column_list)]
    AS select_statement
    [WITH [CASCADED | LOCAL] CHECK OPTION]
```

## Description

This statement changes the definition of a [view](https://mariadb.com/docs/server/server-usage/views), which must exist. The syntax is similar to that for [CREATE VIEW](https://mariadb.com/docs/server/server-usage/views/create-view) and the effect is the same as for `CREATE OR REPLACE VIEW` if the view exists. This statement requires the `CREATE VIEW` and `DROP` [privileges](https://mariadb.com/docs/server/reference/sql-statements/account-management-sql-statements/grant#table-privileges) for the view, and some privilege for each column referred to in the `SELECT` statement. `ALTER VIEW` is allowed only to the definer or users with the [SUPER](https://mariadb.com/docs/server/reference/sql-statements/account-management-sql-statements/grant#global-privileges) privilege.

## Example

```sql
ALTER VIEW v AS SELECT a, a*3 AS a2 FROM t;
```

## See Also

* [CREATE VIEW](https://mariadb.com/docs/server/server-usage/views/create-view)
* [DROP VIEW](https://mariadb.com/docs/server/server-usage/views/drop-view)
* [SHOW CREATE VIEW](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-view)
* [INFORMATION SCHEMA VIEWS Table](https://mariadb.com/docs/server/server-usage/views/information-schema-views-table)

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}
